|
OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
|
Holds the parsed packet as a collection of MeaningElements. More...
#include <Meaning.h>
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. More... | |
| void | zap () |
| empty out all Meaning elements More... | |
| bool | fromPulsetrain (Pulsetrain &train) |
| Convert Pulsetrain to Meaning. More... | |
| Pulsetrain | toPulsetrain () |
| Meaning to Pulsetrain. More... | |
| bool | addPulse (uint16_t pulse_time) |
| Adds a "pulse" Meaning element. More... | |
| bool | addGap (uint16_t pulse_time) |
| Adds a "gap"" Meaning element. More... | |
| bool | addPWM (int space, int mark, int bits, uint8_t *tmp_data) |
| Adds a new meaning element with the specified PWM-encoded data. More... | |
| bool | addPPM (int space, int mark, int filler, int bits, uint8_t *tmp_data) |
| Adds a new meaning element with the specified PPM-encoded data. More... | |
| String | toString () |
Get the String representation, which looks like pulse(5906) + pwm(timing 190/575, 24 bits 0x1772A4) More... | |
| bool | fromString (String in) |
| Read a String representation like above, and store in this instance. More... | |
| int | parsePWM (const Pulsetrain &train, int from, int to, int space, int mark) |
Decode PWM data with specified timings from given range in Pulsetrain to a new Meaning element. Normally called by fromPulsetrain, but can be used from user code also. More... | |
| int | parsePPM (const Pulsetrain &train, int from, int to, int space, int mark, int filler) |
Decode PPM data with specified timings from given range in Pulsetrain to a new Meaning element. Normally called by fromPulsetrain, but can be used from user code also. More... | |
Static Public Member Functions | |
| static bool | maybe (String str) |
| See if String might be a representation of Maening. No guarantees until you try to convert it, but silent. More... | |
Public Attributes | |
| std::vector< MeaningElement > | elements |
| 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. More... | |
| uint16_t | repeats = 0 |
| Number of repeats of the signal. More... | |
| uint16_t | gap = 0 |
| Shortest time between two repetitions. More... | |
Holds the parsed packet as a collection of MeaningElements.
|
static |
See if String might be a representation of Maening. No guarantees until you try to convert it, but silent.
| str | String that we are curious about |
true if it might be a Meaning String, false if not. Definition at line 14 of file Meaning.cpp.
| 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.
| void Meaning::zap | ( | ) |
empty out all Meaning elements
Definition at line 28 of file Meaning.cpp.
| bool Meaning::fromPulsetrain | ( | Pulsetrain & | train | ) |
Convert Pulsetrain to Meaning.
| train | Pulsetrain we want to convert |
true if there was data found, false otherwise. Definition at line 37 of file Meaning.cpp.
| Pulsetrain Meaning::toPulsetrain | ( | ) |
| bool Meaning::addPulse | ( | uint16_t | pulse_time | ) |
Adds a "pulse" Meaning element.
| pulse_time | time in µs |
true Definition at line 392 of file Meaning.cpp.
| bool Meaning::addGap | ( | uint16_t | gap_time | ) |
Adds a "gap"" Meaning element.
| gap_time | time in µs |
true Definition at line 403 of file Meaning.cpp.
| bool Meaning::addPWM | ( | int | space, |
| int | mark, | ||
| int | bits, | ||
| uint8_t * | tmp_data | ||
| ) |
Adds a new meaning element with the specified PWM-encoded data.
| space | time in µs |
| mark | time in µs |
| bits | Length of data at tmp_data IN BITS, not bytes |
| tmp_data | pointer to uint8_t array with the data |
true Definition at line 439 of file Meaning.cpp.
| bool Meaning::addPPM | ( | int | space, |
| int | mark, | ||
| int | filler, | ||
| int | bits, | ||
| uint8_t * | tmp_data | ||
| ) |
Adds a new meaning element with the specified PPM-encoded data.
| space | time in µs |
| mark | time in µs |
| filler | time in µs |
| bits | Length of data at tmp_data IN BITS, not bytes |
| tmp_data | pointer to uint8_t array with the data |
true Definition at line 418 of file Meaning.cpp.
| String Meaning::toString | ( | ) |
Get the String representation, which looks like pulse(5906) + pwm(timing 190/575, 24 bits 0x1772A4)
Definition at line 242 of file Meaning.cpp.
| bool Meaning::fromString | ( | String | in | ) |
Read a String representation like above, and store in this instance.
true if it worked, false (with error message) if it didn't. Definition at line 281 of file Meaning.cpp.
| int Meaning::parsePWM | ( | const Pulsetrain & | train, |
| int | from, | ||
| int | to, | ||
| int | space, | ||
| int | mark | ||
| ) |
Decode PWM data with specified timings from given range in Pulsetrain to a new Meaning element. Normally called by fromPulsetrain, but can be used from user code also.
| train | Pulsetrain we're reading from |
| from | start at this interval |
| to | end before this interval |
| space | bin number (NOT time in µs) for space (first if bit 0) |
| mark | bin number (NOT time in µs) for mark (first if bit 1) |
Definition at line 135 of file Meaning.cpp.
| int Meaning::parsePPM | ( | const Pulsetrain & | train, |
| int | from, | ||
| int | to, | ||
| int | space, | ||
| int | mark, | ||
| int | filler | ||
| ) |
Decode PPM data with specified timings from given range in Pulsetrain to a new Meaning element. Normally called by fromPulsetrain, but can be used from user code also.
| train | Pulsetrain we're reading from |
| from | start at this interval |
| to | end before this interval |
| space | bin number (NOT time in µs) for space (first if bit 0) |
| mark | bin number (NOT time in µs) for mark (first if bit 1) |
| filler | bin number for delineator interval between the mark and space intervals |
Definition at line 184 of file Meaning.cpp.
| std::vector<MeaningElement> Meaning::elements |
The MeaningElement structs that make up the parsed packet.
| bool Meaning::suspected_incomplete = false |
| uint16_t Meaning::repeats = 0 |
| uint16_t Meaning::gap = 0 |