OOKwiz
on/off-keying for ESP32 and a variety of supported radio modules
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
RawTimings Class Reference

RawTimings instances store the time in µs of each interval. More...

#include <RawTimings.h>

Public Member Functions

IRAM_ATTR operator bool ()
 If you try to evaluate the instance as a bool, for instance in if (myRawTimings) ..., it will be true if there's intervals stored. More...
 
void IRAM_ATTR zap ()
 empty out the stored intervals More...
 
String toString ()
 Get the String representation, which is a comma-separated list of intervals. More...
 
bool fromString (const String &in)
 Read a String representation, which is a comma-separated list of intervals, and store in this instance. More...
 
bool fromPulsetrain (Pulsetrain &train)
 Convert Pulsetrain into RawTimings. Loses stats about bins as well as information about repeats. More...
 
Pulsetrain toPulsetrain ()
 RawTimings to Pulsetrain. More...
 
String visualizer ()
 The visualizer like above, with base taken from visualizer_pixel setting. More...
 
String visualizer (int base)
 Returns the viasualizer (the blocky time-graph) for the pulses in this RawTimings instance. More...
 

Static Public Member Functions

static bool maybe (String str)
 Static method to see if String might be a representation of RawTimings. No guarantees until you try to convert it, but silent. More...
 

Public Attributes

std::vector< uint16_t > intervals
 std::vector of uint16_t times in µs for each interval More...
 

Detailed Description

RawTimings instances store the time in µs of each interval.

Definition at line 11 of file RawTimings.h.

Member Function Documentation

◆ maybe()

bool RawTimings::maybe ( String  str)
static

Static method to see if String might be a representation of RawTimings. No guarantees until you try to convert it, but silent.

Parameters
strString that we are curious about
Returns
true if it might be a RawTimings String, false if not. Static, so not called on any particular RawTimings instance but instead like:
if (RawTimings::maybe(someString)) {
....
}
static bool maybe(String str)
Static method to see if String might be a representation of RawTimings. No guarantees until you try t...
Definition: RawTimings.cpp:19

Definition at line 19 of file RawTimings.cpp.

◆ operator bool()

IRAM_ATTR RawTimings::operator bool ( )

If you try to evaluate the instance as a bool, for instance in if (myRawTimings) ..., it will be true if there's intervals stored.

Definition at line 37 of file RawTimings.cpp.

◆ zap()

void IRAM_ATTR RawTimings::zap ( )

empty out the stored intervals

Definition at line 42 of file RawTimings.cpp.

◆ toString()

String RawTimings::toString ( )

Get the String representation, which is a comma-separated list of intervals.

Returns
the String representation

Definition at line 48 of file RawTimings.cpp.

◆ fromString()

bool RawTimings::fromString ( const String &  in)

Read a String representation, which is a comma-separated list of intervals, and store in this instance.

Returns
true if it worked, false (with error message) if it didn't.

Definition at line 61 of file RawTimings.cpp.

◆ fromPulsetrain()

bool RawTimings::fromPulsetrain ( Pulsetrain train)

Convert Pulsetrain into RawTimings. Loses stats about bins as well as information about repeats.

Parameters
trainthe Pulsetrain you want to convert from
Returns
Always true

Definition at line 88 of file RawTimings.cpp.

◆ toPulsetrain()

Pulsetrain RawTimings::toPulsetrain ( )

RawTimings to Pulsetrain.

Returns
Pulsetrain instance

Definition at line 97 of file RawTimings.cpp.

◆ visualizer() [1/2]

String RawTimings::visualizer ( )

The visualizer like above, with base taken from visualizer_pixel setting.

Returns
visualizer String

Definition at line 137 of file RawTimings.cpp.

◆ visualizer() [2/2]

String RawTimings::visualizer ( int  base)

Returns the viasualizer (the blocky time-graph) for the pulses in this RawTimings instance.

Parameters
baseµs per (half-character) block. Every interval gets at least one block so all pulses are guaranteed visible
Returns
visualizer String

Definition at line 106 of file RawTimings.cpp.

Member Data Documentation

◆ intervals

std::vector<uint16_t> RawTimings::intervals

std::vector of uint16_t times in µs for each interval

Definition at line 16 of file RawTimings.h.


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