OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
tools.h
Go to the documentation of this file.
1 #ifndef _TOOLS_H_
2 #define _TOOLS_H_
3 
4 #include <Arduino.h>
5 
6 #define QUOTE_2(x) #x
7 #define QUOTE(x) QUOTE_2(x)
8 #define CONCAT_2(x, y) x##y
9 #define CONCAT(x, y) CONCAT_2(x, y)
10 
11 // So that the stack size can be increased. See config.h for setting
13 
14 #define SPLIT(in, sep, a, b)
15  String a;
16  String b;
17  tools::split(in, sep, a, b);
18 
19 #define snprintf_append(append_to, len, ...)
20  {
21  char buffer[len];
22  snprintf(buffer, len, __VA_ARGS__);
23  append_to = append_to + buffer;
24  }
25 
26 namespace tools {
27 
28  long nthNumberFrom(String &in, int num);
29  void trim(String &in);
30  void shiftInBit(uint8_t* buf, const int len, const bool bit);
31  bool shiftOutBit(uint8_t* buf, const int len);
32  void split(const String &in, const String &separator, String &before, String &after);
33  bool between(const int &compare, const int &lower_bound, const int &upper_bound);
34 
35 }
36 
37 #endif