OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
|
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...
#include <OOKwiz.h>
Static Public Member Functions | |
static bool | setup (bool skip_saved_defaults=false) |
Starts OOKwiz. Loads settings, initializes the radio and starts receiving if it finds the appropriate settings. More... | |
static bool | loop () |
To be called from your own loop() function. More... | |
static bool | receive () |
Tell OOKwiz to start receiving and processing packets. More... | |
static bool | onReceive (void(*callback_function)(RawTimings, Pulsetrain, Meaning)) |
Use this to supply your own function that will be called every time a packet is received. More... | |
static bool | standby () |
Sets radio standby mode, turning off reception. More... | |
static bool | simulate (String &str) |
Pretends this string representation of a RawTimings , Pulsetrain or Meaning instance was just received by the radio. More... | |
static bool | simulate (RawTimings &raw) |
Pretends this RawTimings instance was just received by the radio. More... | |
static bool | simulate (Pulsetrain &train) |
Pretends this Pulsetrain instance was just received by the radio. More... | |
static bool | simulate (Meaning &meaning) |
Pretends this Meaning instance was just received by the radio. More... | |
static bool | transmit (String &str) |
Transmits this string representation of a RawTimings , Pulsetrain or Meaning instance. More... | |
static bool | transmit (RawTimings &raw) |
Transmits this RawTimings instance. More... | |
static bool | transmit (Pulsetrain &train) |
Transmits this Pulsetrain instance. More... | |
static bool | transmit (Meaning &meaning) |
Transmits this Meaning instance. More... | |
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.
Example use of functions from the OOKwiz class
|
static |
Starts OOKwiz. Loads settings, initializes the radio and starts receiving if it finds the appropriate settings.
If you set the GPIO pin for a button on your ESP32 in 'pin_rescue' and press it during boot, 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.
skip_saved_defaults | The settings in the SPIFFS file 'defaults' are not read when this is true, leaving only the factory defaults from config.cpp. |
Definition at line 42 of file OOKwiz.cpp.
|
static |
To be called from your own loop()
function.
Does the high-level processing of packets as soon as they are received and processed by the ISR functions. Handles the serial port output of each packet as well as calling the user's own callback function and the various device plugins.
true
Definition at line 122 of file OOKwiz.cpp.
|
static |
Tell OOKwiz to start receiving and processing packets.
OOKwiz starts in receive mode normally, so you would only need to call this if your code has turned off reception (with standby()
) or if you configured OOKwiz to not start in receive mode by setting start_in_standby
.
true
if receive mode could be activated, false
if not. Definition at line 376 of file OOKwiz.cpp.
|
static |
Use this to supply your own function that will be called every time a packet is received.
The callback_function parameter has to be the function name of a function that takes the three packet representations as arguments and does not return anything. Here's an example sketch:
Make sure your own function is defined exactly as like this, even if you don't need all the parameters. You may change the names of the function and the parameters, but nothing else.
callback_function | The name of your own function, without parenthesis () after it. |
true
Definition at line 364 of file OOKwiz.cpp.
|
static |
Sets radio standby mode, turning off reception.
receive()
, turns off reception. Definition at line 584 of file OOKwiz.cpp.
|
static |
Pretends this string representation of a RawTimings
, Pulsetrain
or Meaning
instance was just received by the radio.
str | The string representation of what needs to be simulated |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 400 of file OOKwiz.cpp.
|
static |
Pretends this RawTimings
instance was just received by the radio.
raw | the instance to be simulated |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 425 of file OOKwiz.cpp.
|
static |
Pretends this Pulsetrain
instance was just received by the radio.
train | the instance to be simulated |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 434 of file OOKwiz.cpp.
|
static |
Pretends this Meaning
instance was just received by the radio.
meaning | the instance to be simulated |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 443 of file OOKwiz.cpp.
|
static |
Transmits this string representation of a RawTimings
, Pulsetrain
or Meaning
instance.
str | The string representation of what needs to be simulated |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 454 of file OOKwiz.cpp.
|
static |
Transmits this RawTimings
instance.
raw | the instance to be transmitted |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 484 of file OOKwiz.cpp.
|
static |
Transmits this Pulsetrain
instance.
train | the instance to be transmitted |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 527 of file OOKwiz.cpp.
|
static |
Transmits this Meaning
instance.
meaning | the instance to be transmitted |
true
if it worked, false
if not. Will show error message telling you why it didn't work in latter case. Definition at line 574 of file OOKwiz.cpp.