diff --git a/CLI_8cpp.html b/CLI_8cpp.html new file mode 100644 index 0000000..c647e02 --- /dev/null +++ b/CLI_8cpp.html @@ -0,0 +1,162 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/CLI.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+Namespaces | +Macros | +Functions | +Variables
+
+
CLI.cpp File Reference
+
+
+
#include "CLI.h"
+#include "config.h"
+#include "serial_output.h"
+#include "tools.h"
+#include "Settings.h"
+#include "Radio.h"
+#include "OOKwiz.h"
+
+

Go to the source code of this file.

+ + + + +

+Namespaces

 CLI
 
+ + + + + +

+Macros

#define COMMAND(c)
 
#define END_CMD   return; }
 
+ + + + + +

+Functions

void CLI::parse (String cmd)
 
void CLI::loop ()
 
+ + + + + +

+Variables

bool CLI::cli_start_msg_printed = false
 
String CLI::serial_buffer
 
+

Macro Definition Documentation

+ +

◆ COMMAND

+ +
+
+ + + + + + + + +
#define COMMAND( c)
+
+Value:
tmp = c;\
+
if (cmd.startsWith(tmp)) {\
+
args = cmd.substring(tmp.length() + 1);\
+ +
void trim(String &in)
Takes spaces off start and end of supplied string, operates in place on String passed in.
Definition: tools.cpp:12
+
+

Definition at line 9 of file CLI.cpp.

+ +
+
+ +

◆ END_CMD

+ +
+
+ + + + +
#define END_CMD   return; }
+
+ +

Definition at line 15 of file CLI.cpp.

+ +
+
+
+ + + + diff --git a/CLI_8cpp_source.html b/CLI_8cpp_source.html index b861cd2..f364e86 100644 --- a/CLI_8cpp_source.html +++ b/CLI_8cpp_source.html @@ -70,7 +70,7 @@
CLI.cpp
-
1 #include "CLI.h"
+Go to the documentation of this file.
1 #include "CLI.h"
2 #include "config.h"
3 #include "serial_output.h"
4 #include "tools.h"
@@ -78,25 +78,25 @@
6 #include "Radio.h"
7 #include "OOKwiz.h"
8 
-
9 #define COMMAND(c)
+
9 #define COMMAND(c)
10  tmp = c;
11  if (cmd.startsWith(tmp)) {
12  args = cmd.substring(tmp.length() + 1);
13  tools::trim(args);
14 
-
15 #define END_CMD return; }
+
15 #define END_CMD return; }
16 
17 
-
18 namespace CLI {
+
18 namespace CLI {
19 
-
20  bool cli_start_msg_printed = false;
-
21  String serial_buffer;
-
22  void parse(String cmd);
+
20  bool cli_start_msg_printed = false;
+ +
22  void parse(String cmd);
23 
-
24  void loop() {
-
25  if (!cli_start_msg_printed) {
+
24  void loop() {
+
25  if (!cli_start_msg_printed) {
26  INFO("CLI started on Serial. Type 'help' for list of commands.\n");
-
27  cli_start_msg_printed = true;
+
27  cli_start_msg_printed = true;
28  }
29  while (Serial.available()) {
30  char inp = Serial.read();
@@ -112,7 +112,7 @@
40  }
41  }
42 
-
43  void parse(String cmd) {
+
43  void parse(String cmd) {
44 
45  String args;
46  String tmp;
diff --git a/CLI_8h.html b/CLI_8h.html new file mode 100644 index 0000000..38fe531 --- /dev/null +++ b/CLI_8h.html @@ -0,0 +1,96 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/CLI.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
CLI.h File Reference
+
+
+
#include <Arduino.h>
+
+

Go to the source code of this file.

+ + + + +

+Namespaces

 CLI
 
+ + + +

+Functions

void CLI::loop ()
 
+
+ + + + diff --git a/CLI_8h_source.html b/CLI_8h_source.html index 4bc39e8..3f763c0 100644 --- a/CLI_8h_source.html +++ b/CLI_8h_source.html @@ -70,13 +70,13 @@
CLI.h
-
1 #ifndef _CLI_H_
+Go to the documentation of this file.
1 #ifndef _CLI_H_
2 #define _CLI_H_
3 
4 #include <Arduino.h>
5 
-
6 namespace CLI {
-
7  void loop();
+
6 namespace CLI {
+
7  void loop();
8 }
9 
10 #endif
diff --git a/Device_8cpp.html b/Device_8cpp.html new file mode 100644 index 0000000..8cadbb4 --- /dev/null +++ b/Device_8cpp.html @@ -0,0 +1,86 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Device.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Device.cpp File Reference
+
+
+
#include "Device.h"
+#include "serial_output.h"
+#include "device_plugins/DEVICE_INDEX"
+#include "tools.h"
+#include "Settings.h"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/Device_8cpp_source.html b/Device_8cpp_source.html index 55293b1..7114e5b 100644 --- a/Device_8cpp_source.html +++ b/Device_8cpp_source.html @@ -70,7 +70,7 @@
Device.cpp
-
1 #include "Device.h"
+Go to the documentation of this file.
1 #include "Device.h"
2 #include "serial_output.h"
3 #include "device_plugins/DEVICE_INDEX"
4 #include "tools.h"
@@ -79,19 +79,19 @@
7 
8 // static members
9 decltype(Device::store) Device::store;
-
10 int Device::len = 0;
+
10 int Device::len = 0;
11 
-
12 bool Device::setup() {
+
12 bool Device::setup() {
13  INFO("Device plugins loaded: %s\n", list().c_str());
14  return true;
15 }
16 
-
17 bool Device::new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning) {
-
18  for (int n = 0; n < len; n++) {
+
17 bool Device::new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning) {
+
18  for (int n = 0; n < len; n++) {
19  String name = store[n].name;
20  if (!Settings::isSet("device_" + name + "_disable")) {
21  DEBUG("Trying device plugin '%s'.\n", name.c_str());
-
22  if(store[n].pointer->receive(raw, train, meaning)) {
+
22  if(store[n].pointer->receive(raw, train, meaning)) {
23  DEBUG("Device plugin '%s' understood it!\n", name.c_str());
24  return true;
25  }
@@ -102,35 +102,35 @@
30 
31 // Uses char*, and does not DEBUG or INFO because this is ran by the contructor
32 // of the AutoRegister trick, so String and Serial are not available yet.
-
33 bool Device::add(const char* name, Device *pointer) {
-
34  if (len == MAX_DEVICES) {
+
33 bool Device::add(const char* name, Device *pointer) {
+
34  if (len == MAX_DEVICES) {
35  return false;
36  }
-
37  strncpy(store[len].name, name, MAX_DEVICE_NAME_LEN);
-
38  store[len].name[MAX_DEVICE_NAME_LEN] = 0; // just in case
-
39  store[len].pointer = pointer;
-
40  len++;
+
37  strncpy(store[len].name, name, MAX_DEVICE_NAME_LEN);
+
38  store[len].name[MAX_DEVICE_NAME_LEN] = 0; // just in case
+
39  store[len].pointer = pointer;
+
40  len++;
41  return true;
42 }
43 
-
44 String Device::list(String separator) {
+
44 String Device::list(String separator) {
45  String ret;
-
46  for (int n = 0; n < len; n++) {
+
46  for (int n = 0; n < len; n++) {
47  ret += store[n].name;
48  String disable_key;
-
49  snprintf_append(disable_key, 50, "device_%s_disable", store[n].name);
+
49  snprintf_append(disable_key, 50, "device_%s_disable", store[n].name);
50  if (Settings::isSet(disable_key)) {
51  ret += " [disabled]";
52  }
-
53  if (n < len - 1) {
+
53  if (n < len - 1) {
54  ret += separator;
55  }
56  }
57  return ret;
58 }
59 
-
60 bool Device::transmit(const String &plugin_name, const String &toTransmit) {
-
61  for (int n = 0; n < len; n++) {
+
60 bool Device::transmit(const String &plugin_name, const String &toTransmit) {
+
61  for (int n = 0; n < len; n++) {
62  if (String(store[n].name) == plugin_name) {
63  return store[n].pointer->transmit(toTransmit);
64  }
@@ -138,11 +138,11 @@
66  return false;
67 }
68 
-
69 bool Device::receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning) {
+
69 bool Device::receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning) {
70  return false;
71 }
72 
-
73 bool Device::transmit(const String &toTransmit) {
+
73 bool Device::transmit(const String &toTransmit) {
74  return false;
75 }
diff --git a/Device_8h.html b/Device_8h.html new file mode 100644 index 0000000..dff8b98 --- /dev/null +++ b/Device_8h.html @@ -0,0 +1,160 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Device.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Device.h File Reference
+
+
+
#include <Arduino.h>
+#include "config.h"
+#include "RawTimings.h"
+#include "Pulsetrain.h"
+#include "Meaning.h"
+#include "tools.h"
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  Device
 
+ + + + + +

+Macros

#define DEVICE_PLUGIN_START(name)
 
#define DEVICE_PLUGIN_END(name)
 
+

Macro Definition Documentation

+ +

◆ DEVICE_PLUGIN_START

+ +
+
+ + + + + + + + +
#define DEVICE_PLUGIN_START( name)
+
+Value:
namespace ook {\
+
namespace device_ ## name {\
+
class DevicePlugin : public Device {\
+
public:
+
Definition: Device.h:32
+
+

Definition at line 11 of file Device.h.

+ +
+
+ +

◆ DEVICE_PLUGIN_END

+ +
+
+ + + + + + + + +
#define DEVICE_PLUGIN_END( name)
+
+Value:
};\
+
struct AutoRegister {\
+
AutoRegister() {\
+
static DevicePlugin devicePlugin;\
+
Device::add(#name, static_cast<Device*>(&devicePlugin));\
+
}\
+
} autoRegister;\
+
\
+
}\
+
}
+
static bool add(const char *name, Device *pointer)
Definition: Device.cpp:33
+
+

Definition at line 17 of file Device.h.

+ +
+
+
+ + + + diff --git a/Device_8h_source.html b/Device_8h_source.html index 29769e8..34282dd 100644 --- a/Device_8h_source.html +++ b/Device_8h_source.html @@ -70,7 +70,7 @@
Device.h
-
1 #ifndef _DEVICE_H_
+Go to the documentation of this file.
1 #ifndef _DEVICE_H_
2 #define _DEVICE_H_
3 
4 #include <Arduino.h>
@@ -80,13 +80,13 @@
8 #include "Meaning.h"
9 #include "tools.h"
10 
-
11 #define DEVICE_PLUGIN_START(name)
+
11 #define DEVICE_PLUGIN_START(name)
12  namespace ook {
13  namespace device_ ## name {
14  class DevicePlugin : public Device {
15  public:
16 
-
17 #define DEVICE_PLUGIN_END(name)
+
17 #define DEVICE_PLUGIN_END(name)
18  };
19  struct AutoRegister {
20  AutoRegister() {
@@ -104,17 +104,17 @@
32 class Device {
33 public:
34  static struct {
-
35  Device* pointer;
-
36  char name[MAX_DEVICE_NAME_LEN];
-
37  } store[MAX_DEVICES];
-
38  static int len;
-
39  static bool setup();
-
40  static bool add(const char* name, Device *pointer);
-
41  static String list(String separator = ", ");
-
42  static bool new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning);
-
43  static bool transmit(const String &plugin_name, const String &toTransmit);
-
44  virtual bool receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning);
-
45  virtual bool transmit(const String &toTransmit);
+ + +
37  } store[MAX_DEVICES];
+
38  static int len;
+
39  static bool setup();
+
40  static bool add(const char* name, Device *pointer);
+
41  static String list(String separator = ", ");
+
42  static bool new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning);
+
43  static bool transmit(const String &plugin_name, const String &toTransmit);
+
44  virtual bool receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning);
+
45  virtual bool transmit(const String &toTransmit);
46 };
47 
48 
diff --git a/Meaning_8cpp.html b/Meaning_8cpp.html new file mode 100644 index 0000000..d96ed62 --- /dev/null +++ b/Meaning_8cpp.html @@ -0,0 +1,87 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Meaning.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Meaning.cpp File Reference
+
+
+
#include "config.h"
+#include "Meaning.h"
+#include "Pulsetrain.h"
+#include "RawTimings.h"
+#include "serial_output.h"
+#include "tools.h"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/Meaning_8cpp_source.html b/Meaning_8cpp_source.html index ff7dcd1..26852dd 100644 --- a/Meaning_8cpp_source.html +++ b/Meaning_8cpp_source.html @@ -70,7 +70,7 @@
Meaning.cpp
-
1 #include "config.h"
+Go to the documentation of this file.
1 #include "config.h"
2 #include "Meaning.h"
3 #include "Pulsetrain.h"
4 #include "RawTimings.h"
@@ -235,7 +235,7 @@
163  for (int n = 0; n < len_in_bytes; n++) {
164  new_element.data.insert(new_element.data.begin(), tmp_data[n]); // reverses order
165  }
-
166  new_element.type = PWM;
+
166  new_element.type = PWM;
167  new_element.time1 = train.bins[space].average;
168  new_element.time2 = train.bins[mark].average;
169  elements.push_back(new_element);
@@ -290,7 +290,7 @@
218  for (int n = 0; n < len_in_bytes; n++) {
219  new_element.data.insert(new_element.data.begin(), tmp_data[n]); // reverses order
220  }
-
221  new_element.type = PPM;
+
221  new_element.type = PPM;
222  new_element.time1 = train.bins[space].average;
223  new_element.time2 = train.bins[mark].average;
224  new_element.time3 = train.bins[filler].average;
@@ -305,7 +305,7 @@
233 /// @return Pulsetrain instance
235  Pulsetrain res;
-
236  res.fromMeaning(*this);
+
236  res.fromMeaning(*this);
237  return res;
238 }
239 
@@ -463,7 +463,7 @@
391 /// @return `true`
392 bool Meaning::addPulse(uint16_t pulse_time) {
393  MeaningElement new_element;
-
394  new_element.type = PULSE;
+
394  new_element.type = PULSE;
395  new_element.time1 = pulse_time;
396  elements.push_back(new_element);
397  return true;
@@ -474,7 +474,7 @@
402 /// @return `true`
403 bool Meaning::addGap(uint16_t gap_time) {
404  MeaningElement new_element;
-
405  new_element.type = GAP;
+
405  new_element.type = GAP;
406  new_element.time1 = gap_time;
407  elements.push_back(new_element);
408  return true;
@@ -494,7 +494,7 @@
422  for (int n = 0; n < len_in_bytes; n++) {
423  new_element.data.push_back(tmp_data[n]);
424  }
-
425  new_element.type = PPM;
+
425  new_element.type = PPM;
426  new_element.time1 = space;
427  new_element.time2 = mark;
428  new_element.time3 = filler;
@@ -515,7 +515,7 @@
443  for (int n = 0; n < len_in_bytes; n++) {
444  new_element.data.push_back(tmp_data[n]);
445  }
-
446  new_element.type = PWM;
+
446  new_element.type = PWM;
447  new_element.time1 = space;
448  new_element.time2 = mark;
449  elements.push_back(new_element);
diff --git a/Meaning_8h.html b/Meaning_8h.html new file mode 100644 index 0000000..204b7bd --- /dev/null +++ b/Meaning_8h.html @@ -0,0 +1,180 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Meaning.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Meaning.h File Reference
+
+
+
#include <vector>
+#include <Arduino.h>
+#include "config.h"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Classes

struct  MeaningElement
 Chunks of parsed packet. Either a pulse, a gap or a block of decoded data. More...
 
class  Meaning
 Holds the parsed packet as a collection of MeaningElements. More...
 
+ + + + + + + +

+Typedefs

typedef enum modulation modulation
 Encodes type of modulation for a MeaningElement. More...
 
typedef struct MeaningElement MeaningElement
 Chunks of parsed packet. Either a pulse, a gap or a block of decoded data. More...
 
+ + + + +

+Enumerations

enum  modulation {
+  UNKNOWN +, PULSE +, GAP +, PWM +,
+  PPM +
+ }
 Encodes type of modulation for a MeaningElement. More...
 
+

Typedef Documentation

+ +

◆ modulation

+ +
+
+ + + + +
typedef enum modulation modulation
+
+ +

Encodes type of modulation for a MeaningElement.

+ +
+
+ +

◆ MeaningElement

+ +
+
+ + + + +
typedef struct MeaningElement MeaningElement
+
+ +

Chunks of parsed packet. Either a pulse, a gap or a block of decoded data.

+ +
+
+

Enumeration Type Documentation

+ +

◆ modulation

+ +
+
+ + + + +
enum modulation
+
+ +

Encodes type of modulation for a MeaningElement.

+ + + + + + +
Enumerator
UNKNOWN 
PULSE 
GAP 
PWM 
PPM 
+ +

Definition at line 11 of file Meaning.h.

+ +
+
+
+ + + + diff --git a/Meaning_8h_source.html b/Meaning_8h_source.html index 9f8e3ac..86218d9 100644 --- a/Meaning_8h_source.html +++ b/Meaning_8h_source.html @@ -70,7 +70,7 @@
Meaning.h
-
1 #ifndef _MEANING_H_
+Go to the documentation of this file.
1 #ifndef _MEANING_H_
2 #define _MEANING_H_
3 
4 #include <vector>
@@ -80,23 +80,23 @@
8 class Pulsetrain;
9 
10 /// @brief Encodes type of modulation for a MeaningElement
-
11 typedef enum modulation {
-
12  UNKNOWN,
-
13  PULSE,
-
14  GAP,
-
15  PWM,
-
16  PPM
-
17 } modulation;
+
11 typedef enum modulation {
+ + +
14  GAP,
+
15  PWM,
+
16  PPM
+
17 } modulation;
18 
19 /// @brief Chunks of parsed packet. Either a pulse, a gap or a block of decoded data
20 typedef struct MeaningElement {
-
21  modulation type;
-
22  std::vector<uint8_t> data;
-
23  uint16_t data_len; // in bits
-
24  uint16_t time1;
-
25  uint16_t time2;
-
26  uint16_t time3;
-
27 } MeaningElement;
+
21  modulation type;
+ +
23  uint16_t data_len; // in bits
+ + + +
27 } MeaningElement;
28 
29 /// @brief Holds the parsed packet as a collection of MeaningElements
30 class Meaning {
diff --git a/OOKwiz_8cpp.html b/OOKwiz_8cpp.html new file mode 100644 index 0000000..b19ea27 --- /dev/null +++ b/OOKwiz_8cpp.html @@ -0,0 +1,84 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/OOKwiz.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
OOKwiz.cpp File Reference
+
+
+
#include "OOKwiz.h"
+#include "CLI.h"
+#include "serial_output.h"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/OOKwiz_8cpp_source.html b/OOKwiz_8cpp_source.html index 23bdca8..3843077 100644 --- a/OOKwiz_8cpp_source.html +++ b/OOKwiz_8cpp_source.html @@ -70,7 +70,7 @@
OOKwiz.cpp
-
1 #include "OOKwiz.h"
+Go to the documentation of this file.
1 #include "OOKwiz.h"
2 #include "CLI.h"
3 #include "serial_output.h"
4 
@@ -92,9 +92,9 @@
20 long OOKwiz::repeat_timeout;
21 bool OOKwiz::rx_active_high;
22 bool OOKwiz::tx_active_high;
-
23 BufferPair OOKwiz::isr_in;
-
24 BufferPair OOKwiz::isr_compare;
-
25 BufferPair OOKwiz::isr_out;
+
23 BufferPair OOKwiz::isr_in;
+
24 BufferPair OOKwiz::isr_compare;
+
25 BufferPair OOKwiz::isr_out;
26 RawTimings OOKwiz::loop_raw;
27 Pulsetrain OOKwiz::loop_train;
28 Meaning OOKwiz::loop_meaning;
@@ -146,12 +146,12 @@
74  }
75  }
76 
-
77  if (!Radio::setup()) {
+
77  if (!Radio::setup()) {
78  ERROR("ERROR: Your radio doesn't set up correctly. Make sure you set the correct\n radio and pins, save settings and reboot.\n");
79  return false;
80  }
81 
-
82  Device::setup();
+
83 
84  // These settings determine what a valid transmission is
85  SETTING_OR_ERROR(pulse_gap_len_new_packet);
@@ -226,7 +226,7 @@
154  }
155  // Have CLI's loop check the serial port for data
156  if (!serial_cli_disable) {
-
157  CLI::loop();
+
157  CLI::loop();
158  }
159  // If there was not a packet received, we can end OOKwiz::loop() now.
160  if (!isr_out.train) {
@@ -236,7 +236,7 @@
164  // Copy away the isr output and allow isr machinery to fill with new
165  loop_train = isr_out.train;
166  loop_raw = isr_out.raw;
-
167  isr_out.zap();
+
167  isr_out.zap();
168  // Warn if we lost packets before this one
169  if (lost_packets) {
170  ERROR("\n\nWARNING: %i packets lost because loop() was not fast enough.\n", lost_packets);
@@ -281,7 +281,7 @@
209  }
210  // Pass what was received to all the device plugins, making their output show up
211  // at the right spot underneath the meaning output.
-
212  Device::new_packet(loop_raw, loop_train, loop_meaning);
+
212  Device::new_packet(loop_raw, loop_train, loop_meaning);
213  // received() can take it now.
214  if (callback != nullptr) {
215  callback(loop_raw, loop_train, loop_meaning);
diff --git a/OOKwiz_8h.html b/OOKwiz_8h.html new file mode 100644 index 0000000..a512c78 --- /dev/null +++ b/OOKwiz_8h.html @@ -0,0 +1,124 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/OOKwiz.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
OOKwiz.h File Reference
+
+
+
#include <Arduino.h>
+#include "config.h"
+#include "Radio.h"
+#include "RawTimings.h"
+#include "Pulsetrain.h"
+#include "Meaning.h"
+#include "Settings.h"
+#include "Device.h"
+#include "tools.h"
+#include "serial_output.h"
+
+

Go to the source code of this file.

+ + + + + + + +

+Classes

struct  BufferPair
 
class  OOKwiz
 The static functions in the OOKwiz class provide the main controls for OOKwiz' functionality. Prefix them with OOKwiz:: to use them from your own code. More...
 
+ + + +

+Typedefs

typedef struct BufferPair BufferPair
 
+

Typedef Documentation

+ +

◆ BufferPair

+ +
+
+ + + + +
typedef struct BufferPair BufferPair
+
+

In the ISR handling of packets, we want to operate on three sets of RawTimings and Pulsetrain (isr_in, isr_compare and isr_out), hence this struct.

+ +
+
+
+ + + + diff --git a/OOKwiz_8h_source.html b/OOKwiz_8h_source.html index a7a6d62..3bb9852 100644 --- a/OOKwiz_8h_source.html +++ b/OOKwiz_8h_source.html @@ -70,7 +70,7 @@
OOKwiz.h
-
1 #ifndef _OOKWIZ_H_
+Go to the documentation of this file.
1 #ifndef _OOKWIZ_H_
2 #define _OOKWIZ_H_
3 
4 #include <Arduino.h>
@@ -89,14 +89,14 @@
17  * In the ISR handling of packets, we want to operate on three sets of RawTimings and Pulsetrain
18  * (isr_in, isr_compare and isr_out), hence this struct.
19 */
-
20 typedef struct BufferPair {
-
21  RawTimings raw;
-
22  Pulsetrain train;
-
23  void zap() {
+
20 typedef struct BufferPair {
+ + +
23  void zap() {
24  raw.zap();
25  train.zap();
26  }
-
27 } BufferPair;
+
27 } BufferPair;
28 
29 /**
30  * \brief The static functions in the OOKwiz class provide the main controls for OOKwiz' functionality.
@@ -154,9 +154,9 @@
82  static long repeat_timeout;
83  static bool rx_active_high;
84  static bool tx_active_high;
-
85  static BufferPair isr_in;
-
86  static BufferPair isr_compare;
-
87  static BufferPair isr_out;
+
85  static BufferPair isr_in;
+
86  static BufferPair isr_compare;
+
87  static BufferPair isr_out;
88  static RawTimings loop_raw;
89  static Pulsetrain loop_train;
90  static Meaning loop_meaning;
diff --git a/Pulsetrain_8cpp.html b/Pulsetrain_8cpp.html new file mode 100644 index 0000000..967a1e1 --- /dev/null +++ b/Pulsetrain_8cpp.html @@ -0,0 +1,88 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Pulsetrain.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Pulsetrain.cpp File Reference
+
+
+
#include <algorithm>
+#include "Pulsetrain.h"
+#include "RawTimings.h"
+#include "Meaning.h"
+#include "Settings.h"
+#include "serial_output.h"
+#include "tools.h"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/Pulsetrain_8cpp_source.html b/Pulsetrain_8cpp_source.html index 64bfc24..9ebcb51 100644 --- a/Pulsetrain_8cpp_source.html +++ b/Pulsetrain_8cpp_source.html @@ -70,7 +70,7 @@
Pulsetrain.cpp
-
1 #include <algorithm> // for std::sort
+Go to the documentation of this file.
1 #include <algorithm> // for std::sort
2 #include "Pulsetrain.h"
3 #include "RawTimings.h"
4 #include "Meaning.h"
@@ -342,7 +342,7 @@
270  return output;
271 }
272 
-
273 bool Pulsetrain::fromMeaning(const Meaning &meaning) {
+
273 bool Pulsetrain::fromMeaning(const Meaning &meaning) {
274  zap();
275  // First make bins for all the different timings found
276  for (const auto& el : meaning.elements) {
diff --git a/Pulsetrain_8h.html b/Pulsetrain_8h.html new file mode 100644 index 0000000..eb9b4d4 --- /dev/null +++ b/Pulsetrain_8h.html @@ -0,0 +1,120 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Pulsetrain.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Pulsetrain.h File Reference
+
+
+
#include <Arduino.h>
+#include <vector>
+#include "config.h"
+
+

Go to the source code of this file.

+ + + + + + + + +

+Classes

struct  pulseBin
 Struct that holds information about a 'bin' in a Pulsetrain, a range of timings that are lumped together when converting RawTimings to a Pulsetrain. More...
 
class  Pulsetrain
 Instances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal. More...
 
+ + + + +

+Typedefs

typedef struct pulseBin pulseBin
 Struct that holds information about a 'bin' in a Pulsetrain, a range of timings that are lumped together when converting RawTimings to a Pulsetrain. More...
 
+

Typedef Documentation

+ +

◆ pulseBin

+ +
+
+ + + + +
typedef struct pulseBin pulseBin
+
+ +

Struct that holds information about a 'bin' in a Pulsetrain, a range of timings that are lumped together when converting RawTimings to a Pulsetrain.

+ +
+
+
+ + + + diff --git a/Pulsetrain_8h_source.html b/Pulsetrain_8h_source.html index 123f438..ab8222c 100644 --- a/Pulsetrain_8h_source.html +++ b/Pulsetrain_8h_source.html @@ -70,7 +70,7 @@
Pulsetrain.h
-
1 #ifndef _PULSETRAIN_H_
+Go to the documentation of this file.
1 #ifndef _PULSETRAIN_H_
2 #define _PULSETRAIN_H_
3 
4 #include <Arduino.h>
@@ -90,7 +90,7 @@
18  long average = 0; // long bc used to store total time before averaging
19  /// @brief Number of intervals in this bin in Pulsetrain
-
21 } pulseBin;
+
21 } pulseBin;
22 
23 /// @brief Instances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal.
24 class Pulsetrain {
@@ -117,7 +117,7 @@ -
48  bool fromMeaning(const Meaning &meaning);
+
48  bool fromMeaning(const Meaning &meaning);
50  String summary() const;
51  bool fromString(String in);
diff --git a/Radio_8cpp.html b/Radio_8cpp.html new file mode 100644 index 0000000..d75ea9a --- /dev/null +++ b/Radio_8cpp.html @@ -0,0 +1,85 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Radio.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Radio.cpp File Reference
+
+
+
#include "Radio.h"
+#include "serial_output.h"
+#include "tools.h"
+#include "radio_plugins/RADIO_INDEX"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/Radio_8cpp_source.html b/Radio_8cpp_source.html index 1660ba9..16561be 100644 --- a/Radio_8cpp_source.html +++ b/Radio_8cpp_source.html @@ -70,7 +70,7 @@
Radio.cpp
-
1 #include "Radio.h"
+Go to the documentation of this file.
1 #include "Radio.h"
2 #include "serial_output.h"
3 #include "tools.h"
4 #include "radio_plugins/RADIO_INDEX"
@@ -78,37 +78,37 @@
6 
7 // static members
8 decltype(Radio::store) Radio::store;
-
9 int Radio::len = 0;
-
10 Radio* Radio::current = nullptr;
-
11 int Radio::pin_rx;
-
12 int Radio::pin_tx;
+
9 int Radio::len = 0;
+
10 Radio* Radio::current = nullptr;
+
11 int Radio::pin_rx;
+
12 int Radio::pin_tx;
13 
14 // Uses char*, and does not DEBUG or INFO because this is ran pre-main by the
15 // constructor of the AutoRegister trick: String and Serial are not available yet.
-
16 bool Radio::add(const char* name, Radio *pointer) {
-
17  if (len == MAX_RADIOS) {
+
16 bool Radio::add(const char* name, Radio *pointer) {
+
17  if (len == MAX_RADIOS) {
18  return false;
19  }
-
20  strncpy(store[len].name, name, MAX_RADIO_NAME_LEN);
-
21  store[len].name[MAX_RADIO_NAME_LEN] = 0; // just in case
-
22  store[len].pointer = pointer;
-
23  len++;
+
20  strncpy(store[len].name, name, MAX_RADIO_NAME_LEN);
+
21  store[len].name[MAX_RADIO_NAME_LEN] = 0; // just in case
+
22  store[len].pointer = pointer;
+
23  len++;
24  return true;
25 }
26 
-
27 bool Radio::setup() {
+
27 bool Radio::setup() {
28  MANDATORY(radio);
29  INFO("Radio plugins loaded: %s\n", list().c_str());
30  if (select(Settings::getString("radio"))) {
-
31  return radio_init();
+
31  return radio_init();
32  }
33  return false;
34 }
35 
-
36 bool Radio::select(const String &name) {
-
37  for (int n = 0; n < len; n++) {
+
36 bool Radio::select(const String &name) {
+
37  for (int n = 0; n < len; n++) {
38  if (strcmp(store[n].name, name.c_str()) == 0) {
-
39  current = store[n].pointer;
+
39  current = store[n].pointer;
40  INFO("Radio %s selected.\n", name);
41  return true;
42  }
@@ -117,81 +117,81 @@
45  return false;
46 }
47 
-
48 String Radio::list(String separator) {
+
48 String Radio::list(String separator) {
49  String ret;
-
50  for (int n = 0; n < len; n++) {
+
50  for (int n = 0; n < len; n++) {
51  ret += store[n].name;
-
52  if (n < len - 1) {
+
52  if (n < len - 1) {
53  ret += separator;
54  }
55  }
56  return ret;
57 }
58 
-
59 String Radio::name() {
-
60  for (int n = 0; n < len; n++) {
-
61  if (store[n].pointer == this) {
-
62  return String(store[n].name);
+
59 String Radio::name() {
+
60  for (int n = 0; n < len; n++) {
+
61  if (store[n].pointer == this) {
+
62  return String(store[n].name);
63  }
64  }
65 }
66 
-
67 bool Radio::radio_init() {
+
67 bool Radio::radio_init() {
69  INFO("Initializing radio.\n");
70  pin_rx = Settings::getInt("pin_rx");
71  pin_tx = Settings::getInt("pin_tx");
-
72  return current->init();
+
72  return current->init();
73 }
74 
-
75 bool Radio::radio_rx() {
+
75 bool Radio::radio_rx() {
77  DEBUG("Configuring radio for receiving.\n");
-
78  if (pin_rx < 0) {
+
78  if (pin_rx < 0) {
79  ERROR("ERROR: pin_rx needs to be set receive.\n");
80  return false;
81  }
82  PIN_MODE(pin_rx, INPUT);
-
83  return current->rx();
+
83  return current->rx();
84 }
85 
-
86 bool Radio::radio_tx() {
+
86 bool Radio::radio_tx() {
88  DEBUG("Configuring radio for transmission.\n");
-
89  if (pin_tx < 0) {
+
89  if (pin_tx < 0) {
90  ERROR("ERROR: pin_tx needs to be set for transmit.\n");
91  return false;
92  }
93  PIN_MODE(pin_tx, OUTPUT);
94  PIN_WRITE(pin_tx, !Settings::isSet("tx_active_high"));
-
95  return current->tx();
+
95  return current->tx();
96 }
97 
-
98 bool Radio::radio_standby() {
+
100  DEBUG("Radio entering standby mode.\n");
-
101  return current->standby();
+
101  return current->standby();
102 }
103 
-
104 bool Radio::init() {
+
104 bool Radio::init() {
105  return false;
106 }
107 
-
108 bool Radio::rx() {
+
108 bool Radio::rx() {
109  return false;
110 }
111 
-
112 bool Radio::tx() {
+
112 bool Radio::tx() {
113  return false;
114 }
115 
-
116 bool Radio::standby() {
+
116 bool Radio::standby() {
117  return false;
118 }
119 
120 // RadioLib-specific
121 
-
122 void Radio::radiolibInit() {
+
123  int pin_sck;
124  SETTING_WITH_DEFAULT(pin_sck, -1);
125  int pin_miso;
@@ -228,7 +228,7 @@
156  INFO("%s: Frequency: %.2f Mhz, bandwidth %.1f kHz, bitrate %.3f kbps\n", name().c_str(), frequency, bandwidth, bitrate);
157 }
158 
-
159 void Radio::showRadiolibResult(const int result, const char* action) {
+
159 void Radio::showRadiolibResult(const int result, const char* action) {
160  switch (result) {
161  case 0:
162  DEBUG("%s: %s returned 0 (OK)\n", name().c_str(), action);
@@ -243,10 +243,10 @@
171  }
172 }
173 
-
174 int Radio::thresholdSetup(const int fixed, const int average, const int peak) {
+
174 int Radio::thresholdSetup(const int fixed, const int average, const int peak) {
175  String threshold_type;
176  SETTING_WITH_DEFAULT(threshold_type, "peak");
-
177  SETTING_WITH_DEFAULT(threshold_level, 6);
+
178  INFO("%s: Threshold type %s, level %i\n", name().c_str(), threshold_type.c_str(), threshold_level);
179  if (threshold_type == "fixed") {
180  return fixed;
diff --git a/Radio_8h.html b/Radio_8h.html new file mode 100644 index 0000000..97461eb --- /dev/null +++ b/Radio_8h.html @@ -0,0 +1,380 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Radio.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Radio.h File Reference
+
+
+
#include <Arduino.h>
+#include <RadioLib.h>
+#include <SPI.h>
+#include "config.h"
+#include "tools.h"
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  Radio
 
+ + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define RADIO_PLUGIN_START
 
#define RADIO_PLUGIN_END
 
#define CHECK_RADIO_SET
 
#define PIN_MODE(x, y)   if (x != -1) pinMode(x, y);
 
#define PIN_WRITE(x, y)   if (x != -1) digitalWrite(x, y);
 
#define PIN_INPUT(x)   if (x != -1) pinMode(x, INPUT)
 
#define PIN_OUTPUT(x)   if (x != -1) pinMode(x, OUTPUT)
 
#define PIN_HIGH(x)   if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, HIGH); }
 
#define PIN_LOW(x)   if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, LOW); }
 
#define RADIO_DO(action)
 
#define MODULE_DO(action)
 
+

Macro Definition Documentation

+ +

◆ RADIO_PLUGIN_START

+ +
+
+ + + + +
#define RADIO_PLUGIN_START
+
+Value:
namespace ook {\
+
namespace CONCAT(radio_, PLUGIN_NAME) {\
+
class RadioPlugin : public Radio {\
+
public:
+
Definition: Radio.h:56
+
#define CONCAT(x, y)
Definition: tools.h:9
+
+

Definition at line 10 of file Radio.h.

+ +
+
+ +

◆ RADIO_PLUGIN_END

+ +
+
+ + + + +
#define RADIO_PLUGIN_END
+
+Value:
};\
+
struct AutoRegister {\
+
AutoRegister() {\
+
static RadioPlugin radioPlugin;\
+
Radio::add(QUOTE(PLUGIN_NAME), static_cast<Radio*>(&radioPlugin));\
+
}\
+
} autoRegister;\
+
}\
+
}
+
static bool add(const char *name, Radio *pointer)
Definition: Radio.cpp:16
+
#define QUOTE(x)
Definition: tools.h:7
+
+

Definition at line 16 of file Radio.h.

+ +
+
+ +

◆ CHECK_RADIO_SET

+ +
+
+ + + + +
#define CHECK_RADIO_SET
+
+Value:
if (current == nullptr) {\
+
ERROR("ERROR: No radio selected.\n");\
+
return false;\
+
}
+
+

Definition at line 27 of file Radio.h.

+ +
+
+ +

◆ PIN_MODE

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PIN_MODE( x,
 
)   if (x != -1) pinMode(x, y);
+
+ +

Definition at line 33 of file Radio.h.

+ +
+
+ +

◆ PIN_WRITE

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PIN_WRITE( x,
 
)   if (x != -1) digitalWrite(x, y);
+
+ +

Definition at line 34 of file Radio.h.

+ +
+
+ +

◆ PIN_INPUT

+ +
+
+ + + + + + + + +
#define PIN_INPUT( x)   if (x != -1) pinMode(x, INPUT)
+
+ +

Definition at line 35 of file Radio.h.

+ +
+
+ +

◆ PIN_OUTPUT

+ +
+
+ + + + + + + + +
#define PIN_OUTPUT( x)   if (x != -1) pinMode(x, OUTPUT)
+
+ +

Definition at line 36 of file Radio.h.

+ +
+
+ +

◆ PIN_HIGH

+ +
+
+ + + + + + + + +
#define PIN_HIGH( x)   if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, HIGH); }
+
+ +

Definition at line 37 of file Radio.h.

+ +
+
+ +

◆ PIN_LOW

+ +
+
+ + + + + + + + +
#define PIN_LOW( x)   if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, LOW); }
+
+ +

Definition at line 38 of file Radio.h.

+ +
+
+ +

◆ RADIO_DO

+ +
+
+ + + + + + + + +
#define RADIO_DO( action)
+
+Value:
{\
+
int res = radio->action;\
+
showRadiolibResult(res, #action);\
+
if (res != 0) return false;\
+
}
+
+

Definition at line 41 of file Radio.h.

+ +
+
+ +

◆ MODULE_DO

+ +
+
+ + + + + + + + +
#define MODULE_DO( action)
+
+Value:
{\
+
int res = radioLibModule->action;\
+
showRadiolibResult(res, #action);\
+
if (res != 0) return false;\
+
}
+
+

Definition at line 47 of file Radio.h.

+ +
+
+
+ + + + diff --git a/Radio_8h_source.html b/Radio_8h_source.html index d919946..3947ecc 100644 --- a/Radio_8h_source.html +++ b/Radio_8h_source.html @@ -70,7 +70,7 @@
Radio.h
-
1 #ifndef _RADIO_H_
+Go to the documentation of this file.
1 #ifndef _RADIO_H_
2 #define _RADIO_H_
3 
4 #include <Arduino.h>
@@ -79,13 +79,13 @@
7 #include "config.h"
8 #include "tools.h"
9 
-
10 #define RADIO_PLUGIN_START
+
10 #define RADIO_PLUGIN_START
11  namespace ook {
12  namespace CONCAT(radio_, PLUGIN_NAME) {
13  class RadioPlugin : public Radio {
14  public:
15 
-
16 #define RADIO_PLUGIN_END
+
16 #define RADIO_PLUGIN_END
17  };
18  struct AutoRegister {
19  AutoRegister() {
@@ -96,27 +96,27 @@
24  }
25  }
26 
-
27 #define CHECK_RADIO_SET
+
27 #define CHECK_RADIO_SET
28  if (current == nullptr) {
29  ERROR("ERROR: No radio selected.\n");
30  return false;
31  }
32 
-
33 #define PIN_MODE(x, y) if (x != -1) pinMode(x, y);
-
34 #define PIN_WRITE(x, y) if (x != -1) digitalWrite(x, y);
-
35 #define PIN_INPUT(x) if (x != -1) pinMode(x, INPUT)
-
36 #define PIN_OUTPUT(x) if (x != -1) pinMode(x, OUTPUT)
-
37 #define PIN_HIGH(x) if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, HIGH); }
-
38 #define PIN_LOW(x) if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, LOW); }
+
33 #define PIN_MODE(x, y) if (x != -1) pinMode(x, y);
+
34 #define PIN_WRITE(x, y) if (x != -1) digitalWrite(x, y);
+
35 #define PIN_INPUT(x) if (x != -1) pinMode(x, INPUT)
+
36 #define PIN_OUTPUT(x) if (x != -1) pinMode(x, OUTPUT)
+
37 #define PIN_HIGH(x) if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, HIGH); }
+
38 #define PIN_LOW(x) if (x != -1) { pinMode(x, OUTPUT); digitalWrite(x, LOW); }
39 
40 
-
41 #define RADIO_DO(action) {
+
41 #define RADIO_DO(action) {
42  int res = radio->action;
43  showRadiolibResult(res, #action);
44  if (res != 0) return false;
45  }
46 
-
47 #define MODULE_DO(action) {
+
47 #define MODULE_DO(action) {
48  int res = radioLibModule->action;
49  showRadiolibResult(res, #action);
50  if (res != 0) return false;
@@ -128,42 +128,42 @@
56 class Radio {
57 public:
58  static struct {
-
59  Radio* pointer;
-
60  char name[MAX_RADIO_NAME_LEN];
-
61  } store[MAX_RADIOS];
-
62  static Radio* current;
-
63  static int len;
-
64  static int pin_rx;
-
65  static int pin_tx;
-
66  static bool add(const char* name, Radio *pointer);
-
67  static bool setup();
-
68  static bool select(const String &name);
-
69  static String list(String separator = ", ");
-
70  static bool radio_init();
-
71  static bool radio_rx();
-
72  static bool radio_tx();
-
73  static bool radio_standby();
-
74  String name();
-
75  virtual bool init();
-
76  virtual bool rx();
-
77  virtual bool tx();
-
78  virtual bool standby();
+ + +
61  } store[MAX_RADIOS];
+
62  static Radio* current;
+
63  static int len;
+
64  static int pin_rx;
+
65  static int pin_tx;
+
66  static bool add(const char* name, Radio *pointer);
+
67  static bool setup();
+
68  static bool select(const String &name);
+
69  static String list(String separator = ", ");
+
70  static bool radio_init();
+
71  static bool radio_rx();
+
72  static bool radio_tx();
+
73  static bool radio_standby();
+ +
75  virtual bool init();
+
76  virtual bool rx();
+
77  virtual bool tx();
+
78  virtual bool standby();
79 
80  // radiolib-specific
-
81  Module* radioLibModule;
-
82  SPIClass* spi;
-
83  int pin_cs;
-
84  float frequency;
-
85  float bandwidth;
-
86  float bitrate;
-
87  int threshold_type_fixed;
-
88  int threshold_type_peak;
-
89  int threshold_type_average;
-
90  int threshold_type_int;
-
91  int threshold_level;
-
92  void radiolibInit();
-
93  void showRadiolibResult(const int result, const char* action);
-
94  int thresholdSetup(const int fixed, const int average, const int peak);
+ + +
83  int pin_cs;
+
84  float frequency;
+
85  float bandwidth;
+
86  float bitrate;
+ + + + + +
92  void radiolibInit();
+
93  void showRadiolibResult(const int result, const char* action);
+
94  int thresholdSetup(const int fixed, const int average, const int peak);
95 };
96 
97 #endif
diff --git a/RawTimings_8cpp.html b/RawTimings_8cpp.html new file mode 100644 index 0000000..837f59f --- /dev/null +++ b/RawTimings_8cpp.html @@ -0,0 +1,85 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/RawTimings.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
RawTimings.cpp File Reference
+
+
+
#include "RawTimings.h"
+#include "Pulsetrain.h"
+#include "serial_output.h"
+#include "Settings.h"
+
+

Go to the source code of this file.

+
+ + + + diff --git a/RawTimings_8cpp_source.html b/RawTimings_8cpp_source.html index 2a03859..ea844f5 100644 --- a/RawTimings_8cpp_source.html +++ b/RawTimings_8cpp_source.html @@ -70,7 +70,7 @@
RawTimings.cpp
-
1 #include "RawTimings.h"
+Go to the documentation of this file.
1 #include "RawTimings.h"
2 #include "Pulsetrain.h"
3 #include "serial_output.h"
4 #include "Settings.h"
diff --git a/RawTimings_8h.html b/RawTimings_8h.html new file mode 100644 index 0000000..12498c7 --- /dev/null +++ b/RawTimings_8h.html @@ -0,0 +1,93 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/RawTimings.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
RawTimings.h File Reference
+
+
+
#include <Arduino.h>
+#include <vector>
+#include "config.h"
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  RawTimings
 RawTimings instances store the time in µs of each interval. More...
 
+
+ + + + diff --git a/RawTimings_8h_source.html b/RawTimings_8h_source.html index d72567d..0946488 100644 --- a/RawTimings_8h_source.html +++ b/RawTimings_8h_source.html @@ -70,7 +70,7 @@
RawTimings.h
-
1 #ifndef _RAWTIMINGS_H_
+Go to the documentation of this file.
1 #ifndef _RAWTIMINGS_H_
2 #define _RAWTIMINGS_H_
3 
4 #include <Arduino.h>
diff --git a/Settings_8cpp.html b/Settings_8cpp.html new file mode 100644 index 0000000..d914e1c --- /dev/null +++ b/Settings_8cpp.html @@ -0,0 +1,112 @@ + + + + + + + +OOKwiz: /home/runner/work/OOKwiz/OOKwiz/main/src/Settings.cpp File Reference + + + + + + + + + +
+
+ + + + + + +
+
OOKwiz +
+
on/off-keying for ESP32 and a variety of supported radio modules
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Settings.cpp File Reference
+
+
+
#include "Settings.h"
+#include "config.h"
+#include "serial_output.h"
+#include "FS.h"
+#include "SPIFFS.h"
+#include "tools.h"
+
+

Go to the source code of this file.

+ + + + +

+Variables

Settings dummy
 
+

Variable Documentation

+ +

◆ dummy

+ +
+
+ + + + +
Settings dummy
+
+ +

Definition at line 303 of file Settings.cpp.

+ +
+
+
+ + + + diff --git a/Settings_8cpp_source.html b/Settings_8cpp_source.html index 9865666..585ac9f 100644 --- a/Settings_8cpp_source.html +++ b/Settings_8cpp_source.html @@ -70,7 +70,7 @@
Settings.cpp
-
1 #include "Settings.h"
+Go to the documentation of this file.
1 #include "Settings.h"
2 #include "config.h" // provides factorySettings()
3 #include "serial_output.h"
4 #include "FS.h"
@@ -80,8 +80,8 @@
8 std::map<String, String> Settings::store;
9 
10 // Constructor sets the defaults, see 'dummy' at end
-
11 Settings::Settings() {
-
12  factorySettings();
+ +
13 }
14 
15 /// @brief Save settings to file in SPIFFS
@@ -372,7 +372,7 @@
300  return dflt;
301 }
302 
-
303 Settings dummy; // so the constructor runs once for the default settings
+
303 Settings dummy; // so the constructor runs once for the default settings
-
1 #ifndef _SETTINGS_H_
+Go to the documentation of this file.
1 #ifndef _SETTINGS_H_
2 #define _SETTINGS_H_
3 
4 #include <map>
@@ -79,23 +79,23 @@
7 #include "config.h"
8 
9 // Update same-named variable only if setting exists
-
10 #define SETTING(name) Settings::get(#name, name);
+
10 #define SETTING(name) Settings::get(#name, name);
11 
12 // Same but now sets the already existing variable to the
13 // default if setting doesn't exist.
-
14 #define SETTING_WITH_DEFAULT(name, default) if (!Settings::get(#name, name)) name = default;
+
14 #define SETTING_WITH_DEFAULT(name, default) if (!Settings::get(#name, name)) name = default;
15 
16 // For use in functions that return a bool. Assumes there is
17 // a variable (int, long, String or float) of the same name
18 // as the setting, and sets that variable to the value in the
19 // setting. If no such setting found, will show ERROR and then
20 // will "return false;" out of the function you call this from.
-
21 #define SETTING_OR_ERROR(name) if (!Settings::get(#name, name)) {
+
21 #define SETTING_OR_ERROR(name) if (!Settings::get(#name, name)) {
22  ERROR("Mandatory setting '%s' missing.\n", #name);
23  return false;\
24 }
25 
-
26 #define MANDATORY(name) if (!Settings::isSet(#name)) {
+
26 #define MANDATORY(name) if (!Settings::isSet(#name)) {
27  ERROR("Mandatory setting '%s' missing.\n", #name);
28  return false;\
29 }
@@ -103,11 +103,11 @@
31 class Settings {
32 
33 public:
-
34  Settings();
+
34  Settings();
35  static bool set(const String &name, const String &value = "");
36 
37  template <typename T>
-
38  static bool set(const String &name, const T &value = "") {
+
38  static bool set(const String &name, const T &value = "") {
39  return set(name, String(value));
40  }
41 
diff --git a/annotated.html b/annotated.html index 156ab21..d67fa78 100644 --- a/annotated.html +++ b/annotated.html @@ -68,15 +68,16 @@
Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - - - - - - + + + + + + + + + +
 CDevice
 CMeaningHolds the parsed packet as a collection of MeaningElements
 CMeaningElementChunks of parsed packet. Either a pulse, a gap or a block of decoded data
 COOKwizThe static functions in the OOKwiz class provide the main controls for OOKwiz' functionality. Prefix them with OOKwiz:: to use them from your own code
 CpulseBinStruct that holds information about a 'bin' in a Pulsetrain, a range of timings that are lumped together when converting RawTimings to a Pulsetrain
 CPulsetrainInstances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal
 CRadio
 CRawTimingsRawTimings instances store the time in µs of each interval
 CSettings
 CBufferPair
 CDevice
 CMeaningHolds the parsed packet as a collection of MeaningElements
 CMeaningElementChunks of parsed packet. Either a pulse, a gap or a block of decoded data
 COOKwizThe static functions in the OOKwiz class provide the main controls for OOKwiz' functionality. Prefix them with OOKwiz:: to use them from your own code
 CpulseBinStruct that holds information about a 'bin' in a Pulsetrain, a range of timings that are lumped together when converting RawTimings to a Pulsetrain
 CPulsetrainInstances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal
 CRadio
 CRawTimingsRawTimings instances store the time in µs of each interval
 CSettings
diff --git a/classDevice-members.html b/classDevice-members.html index 51edb4c..d11ad4d 100644 --- a/classDevice-members.html +++ b/classDevice-members.html @@ -69,17 +69,17 @@

This is the complete list of members for Device, including all inherited members.

- - - - - - - - - - - + + + + + + + + + + +
add(const char *name, Device *pointer) (defined in Device)Devicestatic
len (defined in Device)Devicestatic
list(String separator=", ") (defined in Device)Devicestatic
name (defined in Device)Device
new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning) (defined in Device)Devicestatic
pointer (defined in Device)Device
receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning) (defined in Device)Devicevirtual
setup() (defined in Device)Devicestatic
store (defined in Device)Devicestatic
transmit(const String &plugin_name, const String &toTransmit) (defined in Device)Devicestatic
transmit(const String &toTransmit) (defined in Device)Devicevirtual
add(const char *name, Device *pointer)Devicestatic
lenDevicestatic
list(String separator=", ")Devicestatic
nameDevice
new_packet(RawTimings &raw, Pulsetrain &train, Meaning &meaning)Devicestatic
pointerDevice
receive(const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning)Devicevirtual
setup()Devicestatic
storeDevicestatic
transmit(const String &plugin_name, const String &toTransmit)Devicestatic
transmit(const String &toTransmit)Devicevirtual
+ +

#include <Device.h>

- + - +

Public Member Functions

-virtual bool receive (const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning)
virtual bool receive (const RawTimings &raw, const Pulsetrain &train, const Meaning &meaning)
 
-virtual bool transmit (const String &toTransmit)
virtual bool transmit (const String &toTransmit)
 
- + - + - + - + - +

Static Public Member Functions

-static bool setup ()
static bool setup ()
 
-static bool add (const char *name, Device *pointer)
static bool add (const char *name, Device *pointer)
 
-static String list (String separator=", ")
static String list (String separator=", ")
 
-static bool new_packet (RawTimings &raw, Pulsetrain &train, Meaning &meaning)
static bool new_packet (RawTimings &raw, Pulsetrain &train, Meaning &meaning)
 
-static bool transmit (const String &plugin_name, const String &toTransmit)
static bool transmit (const String &plugin_name, const String &toTransmit)
 
- - + + - + - + - +

Static Public Attributes

-struct {
-   Device *   pointer
struct {
   Device *   pointer
 
-   char   name [MAX_DEVICE_NAME_LEN]
   char   name [MAX_DEVICE_NAME_LEN]
 
store [MAX_DEVICES]
store [MAX_DEVICES]
 
-static int len = 0
static int len = 0
 

Detailed Description

Definition at line 32 of file Device.h.

-

The documentation for this class was generated from the following files:
    +

Member Function Documentation

+ +

◆ setup()

+ +
+
+ + + + + +
+ + + + + + + +
bool Device::setup ()
+
+static
+
+ +

Definition at line 12 of file Device.cpp.

+ +
+
+ +

◆ add()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Device::add (const char * name,
Devicepointer 
)
+
+static
+
+ +

Definition at line 33 of file Device.cpp.

+ +
+
+ +

◆ list()

+ +
+
+ + + + + +
+ + + + + + + + +
String Device::list (String separator = ", ")
+
+static
+
+ +

Definition at line 44 of file Device.cpp.

+ +
+
+ +

◆ new_packet()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool Device::new_packet (RawTimingsraw,
Pulsetraintrain,
Meaningmeaning 
)
+
+static
+
+ +

Definition at line 17 of file Device.cpp.

+ +
+
+ +

◆ transmit() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool Device::transmit (const String & plugin_name,
const String & toTransmit 
)
+
+static
+
+ +

Definition at line 60 of file Device.cpp.

+ +
+
+ +

◆ receive()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool Device::receive (const RawTimingsraw,
const Pulsetraintrain,
const Meaningmeaning 
)
+
+virtual
+
+ +

Definition at line 69 of file Device.cpp.

+ +
+
+ +

◆ transmit() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool Device::transmit (const String & toTransmit)
+
+virtual
+
+ +

Definition at line 73 of file Device.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ pointer

+ +
+
+ + + + +
Device* Device::pointer
+
+ +

Definition at line 35 of file Device.h.

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char Device::name[MAX_DEVICE_NAME_LEN]
+
+ +

Definition at line 36 of file Device.h.

+ +
+
+ +

◆ 

+ +
+
+ + + + +
struct { ... } Device::store[MAX_DEVICES]
+
+ +
+
+ +

◆ len

+ +
+
+ + + + + +
+ + + + +
int Device::len = 0
+
+static
+
+ +

Definition at line 38 of file Device.h.

+ +
+
+
The documentation for this class was generated from the following files:
  • /home/runner/work/OOKwiz/OOKwiz/main/src/Device.h
  • /home/runner/work/OOKwiz/OOKwiz/main/src/Device.cpp
diff --git a/classMeaning.html b/classMeaning.html index 28be6cf..455c84f 100644 --- a/classMeaning.html +++ b/classMeaning.html @@ -79,13 +79,11 @@ - - + + - - + + @@ -126,21 +124,17 @@

Public Member Functions

operator bool ()
 If you try to evaluate the instance as a bool, for instance in if (myMeaning) ..., it will be true if this holds Meaning elements.
 operator bool ()
 If you try to evaluate the instance as a bool, for instance in if (myMeaning) ..., it will be true if this holds Meaning elements. More...
 
-void zap ()
 empty out all Meaning elements
void zap ()
 empty out all Meaning elements More...
 
bool fromPulsetrain (Pulsetrain &train)
 Convert Pulsetrain to Meaning. More...
- - + + - - + + - - + + - - + +

Public Attributes

-std::vector< MeaningElementelements
 The MeaningElement structs that make up the parsed packet.
std::vector< MeaningElementelements
 The MeaningElement structs that make up the parsed packet. More...
 
-bool suspected_incomplete = false
 Set when there were no repetitions and the number of bits detected is not divisible by 4.
bool suspected_incomplete = false
 Set when there were no repetitions and the number of bits detected is not divisible by 4. More...
 
-uint16_t repeats = 0
 Number of repeats of the signal.
uint16_t repeats = 0
 Number of repeats of the signal. More...
 
-uint16_t gap = 0
 Shortest time between two repetitions.
uint16_t gap = 0
 Shortest time between two repetitions. More...
 

Detailed Description

@@ -183,6 +177,48 @@

Definition at line 14 of file Meaning.cpp.

+

+
+ +

◆ operator bool()

+ +
+
+ + + + + + + +
Meaning::operator bool ()
+
+ +

If you try to evaluate the instance as a bool, for instance in if (myMeaning) ..., it will be true if this holds Meaning elements.

+ +

Definition at line 23 of file Meaning.cpp.

+ +
+
+ +

◆ zap()

+ +
+
+ + + + + + + +
void Meaning::zap ()
+
+ +

empty out all Meaning elements

+ +

Definition at line 28 of file Meaning.cpp.

+
@@ -581,6 +617,79 @@

Definition at line 184 of file Meaning.cpp.

+

+
+

Member Data Documentation

+ +

◆ elements

+ +
+
+ + + + +
std::vector<MeaningElement> Meaning::elements
+
+ +

The MeaningElement structs that make up the parsed packet.

+ +

Definition at line 33 of file Meaning.h.

+ +
+
+ +

◆ suspected_incomplete

+ +
+
+ + + + +
bool Meaning::suspected_incomplete = false
+
+ +

Set when there were no repetitions and the number of bits detected is not divisible by 4.

+ +

Definition at line 35 of file Meaning.h.

+ +
+
+ +

◆ repeats

+ +
+
+ + + + +
uint16_t Meaning::repeats = 0
+
+ +

Number of repeats of the signal.

+ +

Definition at line 37 of file Meaning.h.

+ +
+
+ +

◆ gap

+ +
+
+ + + + +
uint16_t Meaning::gap = 0
+
+ +

Shortest time between two repetitions.

+ +

Definition at line 39 of file Meaning.h.

+

The documentation for this class was generated from the following files:
    diff --git a/classOOKwiz.html b/classOOKwiz.html index 6894237..0f6d65a 100644 --- a/classOOKwiz.html +++ b/classOOKwiz.html @@ -159,7 +159,7 @@

    OOKwiz will not initialize SPI and the radio, possibly breaking an endless boot loop. Set 'rescue_active_high' if the button connects to VCC instead of GND.

    Normally, OOKwiz will start up in receive mode. If you set 'start_in_standby', it will start in standby mode instead.

    Parameters
    -
    skip_saved_defaultsThe settings in the SPIFFS file 'defaults' are not read when this is true, leaving only the factory defaults from config.cpp.
    +
    skip_saved_defaultsThe settings in the SPIFFS file 'defaults' are not read when this is true, leaving only the factory defaults from config.cpp.
    diff --git a/classPulsetrain-members.html b/classPulsetrain-members.html index 4fce235..01e5c1a 100644 --- a/classPulsetrain-members.html +++ b/classPulsetrain-members.html @@ -73,7 +73,7 @@ binsPulsetrain durationPulsetrain first_atPulsetrain - fromMeaning(const Meaning &meaning) (defined in Pulsetrain)Pulsetrain + fromMeaning(const Meaning &meaning)Pulsetrain fromRawTimings(const RawTimings &raw)Pulsetrain fromString(String in)Pulsetrain gapPulsetrain diff --git a/classPulsetrain.html b/classPulsetrain.html index 1fb7a4c..fdb42d8 100644 --- a/classPulsetrain.html +++ b/classPulsetrain.html @@ -79,13 +79,11 @@ - - + + - - + + @@ -96,8 +94,7 @@ - + @@ -129,33 +126,26 @@

    Public Member Functions

    -IRAM_ATTR operator bool ()
     If you try to evaluate the instance as a bool (e.g. if (myPulsetrain) ...) this will be true if there's transitions stored.
    IRAM_ATTR operator bool ()
     If you try to evaluate the instance as a bool (e.g. if (myPulsetrain) ...) this will be true if there's transitions stored. More...
     
    -void IRAM_ATTR zap ()
     empty out all information about the stored pulses
    void IRAM_ATTR zap ()
     empty out all information about the stored pulses More...
     
    bool IRAM_ATTR sameAs (const Pulsetrain &other_train)
     Compare to other Pulsetrains to see if same packet. Ignores minor timing differences. Used internally by ISR processing to see if packet is a repeat. More...
    RawTimings toRawTimings ()
     Pulsetrain to RawTimings. More...
     
    -bool fromMeaning (const Meaning &meaning)
    bool fromMeaning (const Meaning &meaning)
     
    Meaning toMeaning ()
     Pulsetrain to Meaning. More...
    - - + + - - + + - - + + - - + + - - + + - - + + - - + +

    Public Attributes

    -std::vector< pulseBinbins
     std::vector with the bins, each a PulseBin struct
    std::vector< pulseBinbins
     std::vector with the bins, each a PulseBin struct More...
     
    -std::vector< uint8_t > transitions
     std::vector with the transitions, each merely the pulsebin that transition is in
    std::vector< uint8_t > transitions
     std::vector with the transitions, each merely the pulsebin that transition is in More...
     
    -uint32_t duration = 0
     Total duration of this Pulsetrain in µs.
    uint32_t duration = 0
     Total duration of this Pulsetrain in µs. More...
     
    -int64_t first_at = 0
     First seen at this time, in system microseconds.
    int64_t first_at = 0
     First seen at this time, in system microseconds. More...
     
    -int64_t last_at = 0
     Last seen at this time, in system microseconds.
    int64_t last_at = 0
     Last seen at this time, in system microseconds. More...
     
    -uint16_t repeats = 0
     Number of repetitions detected before either another packet came or repeat_timeout µs elapsed.
    uint16_t repeats = 0
     Number of repetitions detected before either another packet came or repeat_timeout µs elapsed. More...
     
    -uint16_t gap = 0
     Smallest gap between repeated transmissions.
    uint16_t gap = 0
     Smallest gap between repeated transmissions. More...
     

    Detailed Description

    @@ -198,6 +188,48 @@

    Definition at line 15 of file Pulsetrain.cpp.

    +

+
+ +

◆ operator bool()

+ +
+
+ + + + + + + +
IRAM_ATTR Pulsetrain::operator bool ()
+
+ +

If you try to evaluate the instance as a bool (e.g. if (myPulsetrain) ...) this will be true if there's transitions stored.

+ +

Definition at line 29 of file Pulsetrain.cpp.

+ +
+
+ +

◆ zap()

+ +
+
+ + + + + + + +
void IRAM_ATTR Pulsetrain::zap ()
+
+ +

empty out all information about the stored pulses

+ +

Definition at line 34 of file Pulsetrain.cpp.

+
@@ -278,6 +310,26 @@

Definition at line 212 of file Pulsetrain.cpp.

+

+
+ +

◆ fromMeaning()

+ +
+
+ + + + + + + + +
bool Pulsetrain::fromMeaning (const Meaningmeaning)
+
+ +

Definition at line 273 of file Pulsetrain.cpp.

+
@@ -440,6 +492,133 @@

Definition at line 240 of file Pulsetrain.cpp.

+

+
+

Member Data Documentation

+ +

◆ bins

+ +
+
+ + + + +
std::vector<pulseBin> Pulsetrain::bins
+
+ +

std::vector with the bins, each a PulseBin struct

+ +

Definition at line 29 of file Pulsetrain.h.

+ +
+
+ +

◆ transitions

+ +
+
+ + + + +
std::vector<uint8_t> Pulsetrain::transitions
+
+ +

std::vector with the transitions, each merely the pulsebin that transition is in

+ +

Definition at line 31 of file Pulsetrain.h.

+ +
+
+ +

◆ duration

+ +
+
+ + + + +
uint32_t Pulsetrain::duration = 0
+
+ +

Total duration of this Pulsetrain in µs.

+ +

Definition at line 33 of file Pulsetrain.h.

+ +
+
+ +

◆ first_at

+ +
+
+ + + + +
int64_t Pulsetrain::first_at = 0
+
+ +

First seen at this time, in system microseconds.

+ +

Definition at line 35 of file Pulsetrain.h.

+ +
+
+ +

◆ last_at

+ +
+
+ + + + +
int64_t Pulsetrain::last_at = 0
+
+ +

Last seen at this time, in system microseconds.

+ +

Definition at line 37 of file Pulsetrain.h.

+ +
+
+ +

◆ repeats

+ +
+
+ + + + +
uint16_t Pulsetrain::repeats = 0
+
+ +

Number of repetitions detected before either another packet came or repeat_timeout µs elapsed.

+ +

Definition at line 39 of file Pulsetrain.h.

+ +
+
+ +

◆ gap

+ +
+
+ + + + +
uint16_t Pulsetrain::gap = 0
+
+ +

Smallest gap between repeated transmissions.

+ +

Definition at line 41 of file Pulsetrain.h.

+

The documentation for this class was generated from the following files: