OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
|
Instances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal. More...
#include <Pulsetrain.h>
Public Member Functions | |
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 | zap () |
empty out all information about the stored pulses More... | |
bool | 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... | |
bool | fromRawTimings (const RawTimings &raw) |
Convert RawTimings to Pulsetrain. More... | |
RawTimings | toRawTimings () |
Pulsetrain to RawTimings. More... | |
bool | fromMeaning (const Meaning &meaning) |
Meaning | toMeaning () |
Pulsetrain to Meaning. More... | |
String | summary () const |
Summary String a la 25 pulses over 24287 µs, repeated 6 times with gaps of 132 µs More... | |
bool | fromString (String in) |
Read a String representation like above, and store in this instance. More... | |
String | toString () const |
Get the String representation, which looks like 2010101100110101001101010010110011001100101100101,190,575,5906*6@132 More... | |
String | binList () |
Get information about the bins in this Pulsetrain, such as lowest, average and highest interval as well as number of pulses in each bin. More... | |
String | visualizer () |
Returns the viasualizer (the blocky time-graph) for the pulses in this Pulsetrain instance. More... | |
String | visualizer (int base) |
The visualizer like above, with base taken from visualizer_pixel setting. More... | |
Static Public Member Functions | |
static bool | maybe (String str) |
See if String might be a representation of Pulsetrain. No guarantees until you try to convert it, but silent. More... | |
Public Attributes | |
std::vector< pulseBin > | bins |
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 More... | |
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. More... | |
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. More... | |
uint16_t | gap = 0 |
Smallest gap between repeated transmissions. More... | |
Instances of Pulsetrain represent packets in a normalized way, meaning all intervals of similar length are made equal.
Definition at line 24 of file Pulsetrain.h.
|
static |
See if String might be a representation of Pulsetrain. No guarantees until you try to convert it, but silent.
str | String that we are curious about |
true
if it might be a Pulsetrain String, false
if not. Definition at line 15 of file Pulsetrain.cpp.
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.
void IRAM_ATTR Pulsetrain::zap | ( | ) |
empty out all information about the stored pulses
Definition at line 34 of file Pulsetrain.cpp.
bool IRAM_ATTR Pulsetrain::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.
other_train | Pulsetrain we're comparing this one to |
true
if same, false
if not Definition at line 45 of file Pulsetrain.cpp.
bool IRAM_ATTR Pulsetrain::fromRawTimings | ( | const RawTimings & | raw | ) |
Convert RawTimings to Pulsetrain.
raw | the RawTimings instance to convert from |
true
Definition at line 168 of file Pulsetrain.cpp.
RawTimings Pulsetrain::toRawTimings | ( | ) |
bool Pulsetrain::fromMeaning | ( | const Meaning & | meaning | ) |
Definition at line 274 of file Pulsetrain.cpp.
Meaning Pulsetrain::toMeaning | ( | ) |
String Pulsetrain::summary | ( | ) | const |
Summary String a la 25 pulses over 24287 µs, repeated 6 times with gaps of 132 µs
Definition at line 156 of file Pulsetrain.cpp.
bool Pulsetrain::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 87 of file Pulsetrain.cpp.
String Pulsetrain::toString | ( | ) | const |
Get the String representation, which looks like 2010101100110101001101010010110011001100101100101,190,575,5906*6@132
Definition at line 67 of file Pulsetrain.cpp.
String Pulsetrain::binList | ( | ) |
Get information about the bins in this Pulsetrain, such as lowest, average and highest interval as well as number of pulses in each bin.
Definition at line 221 of file Pulsetrain.cpp.
String Pulsetrain::visualizer | ( | ) |
Returns the viasualizer (the blocky time-graph) for the pulses in this Pulsetrain instance.
base | µs per (half-character) block. Every interval gets at least one block so all pulses are guaranteed visible |
Definition at line 233 of file Pulsetrain.cpp.
String Pulsetrain::visualizer | ( | int | base | ) |
The visualizer like above, with base taken from visualizer_pixel
setting.
Definition at line 241 of file Pulsetrain.cpp.
std::vector<pulseBin> Pulsetrain::bins |
std::vector with the bins, each a PulseBin struct
Definition at line 29 of file Pulsetrain.h.
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.
uint32_t Pulsetrain::duration = 0 |
Total duration of this Pulsetrain in µs.
Definition at line 33 of file Pulsetrain.h.
int64_t Pulsetrain::first_at = 0 |
First seen at this time, in system microseconds.
Definition at line 35 of file Pulsetrain.h.
int64_t Pulsetrain::last_at = 0 |
Last seen at this time, in system microseconds.
Definition at line 37 of file Pulsetrain.h.
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.
uint16_t Pulsetrain::gap = 0 |
Smallest gap between repeated transmissions.
Definition at line 41 of file Pulsetrain.h.