Infrared4Arduino 1.2.3
|
This class models an IR signal with intro-, repeat-, and ending sequences. More...
#include <IrSignal.h>
Public Member Functions | |
IrSignal () | |
Constructs an empty IrSignal. More... | |
IrSignal (const IrSignal &orig)=default | |
IrSignal (IrSignal &&orig)=default | |
IrSignal & | operator= (const IrSignal &rhs)=default |
IrSignal & | operator= (IrSignal &&rhs)=default |
virtual | ~IrSignal ()=default |
IrSignal (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, const microseconds_t *ending, size_t lengthEnding, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Constructor that "moves" the data pointers. More... | |
IrSignal (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Constructor that "moves" the data pointers. More... | |
IrSignal (const IrSequence &intro, const IrSequence &repeat, const IrSequence &ending, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Copy constructor. More... | |
IrSignal (IrSequence &&intro, IrSequence &&repeat, IrSequence &&ending, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Move constructor. More... | |
IrSignal (const IrSequence &intro, const IrSequence &repeat, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Copy constructors for IrSignals without ending sequence. More... | |
IrSignal (IrSequence &&intro, IrSequence &&repeat, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) | |
Move constructor for IrSignals without ending sequence. More... | |
frequency_t | getFrequency () const |
dutycycle_t | getDutyCycle () const |
const IrSequence & | getEnding () const |
const IrSequence & | getRepeat () const |
const IrSequence & | getIntro () const |
operator bool () const | |
True if and only if at least one of the sequences is true (= non-empty). More... | |
void | dump (Stream &stream, bool usingSigns=false) const |
Print a human readable representation of the IrSignal on the Stream supplied. More... | |
void | dumpWithSigns (Stream &stream) const |
Print a human readable representation of the IrSignal on the Stream supplied, using signs. More... | |
bool | dumpFrequency (Stream &stream) const |
If the frequency is sensible, print it to the stream and return true. More... | |
bool | dumpDutyCycle (Stream &stream) const |
If the duty cycle is sensible, print it to the stream and return true. More... | |
unsigned int | noRepetitions (unsigned int noSends) const |
Implementation of the count semantics, i.e., how many repetitions should be sent if the signal is sent noSend times. More... | |
Static Public Member Functions | |
static IrSignal * | readFlash (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, const microseconds_t *ending, size_t lengthEnding, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) |
static IrSignal * | readFlash (const microseconds_t *intro, size_t lengthIntro, const microseconds_t *repeat, size_t lengthRepeat, frequency_t frequency=defaultFrequency, dutycycle_t dutyCycle=defaultDutyCycle) |
static bool | dumpFrequency (Stream &stream, frequency_t frequency) |
Static version of dumpFrequency. More... | |
static bool | dumpDutyCycle (Stream &stream, dutycycle_t dutyCycle) |
Static version of dumpDutyCycle. More... | |
Static Public Attributes | |
static constexpr frequency_t | defaultFrequency = 38000U |
static constexpr frequency_t | invalidFrequency = static_cast<frequency_t>(-1) |
static constexpr dutycycle_t | noDutyCycle = static_cast<dutycycle_t>(-1) |
static constexpr dutycycle_t | defaultDutyCycle = noDutyCycle |
static constexpr const char * | version = VERSION |
This class models an IR signal with intro-, repeat-, and ending sequences.
This class is immutable.
Definition at line 11 of file IrSignal.h.
|
inline |
Constructs an empty IrSignal.
Definition at line 32 of file IrSignal.h.
|
default |
|
default |
|
virtualdefault |
IrSignal::IrSignal | ( | const microseconds_t * | intro, |
size_t | lengthIntro, | ||
const microseconds_t * | repeat, | ||
size_t | lengthRepeat, | ||
const microseconds_t * | ending, | ||
size_t | lengthEnding, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Constructor that "moves" the data pointers.
This is essentially a convenience function that combines IrSequence and IrSignal constructors.
intro | |
lengthIntro | |
repeat | |
lengthRepeat | |
ending | |
lengthEnding | |
frequency | |
dutyCycle |
Definition at line 24 of file IrSignal.cpp.
IrSignal::IrSignal | ( | const microseconds_t * | intro, |
size_t | lengthIntro, | ||
const microseconds_t * | repeat, | ||
size_t | lengthRepeat, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Constructor that "moves" the data pointers.
No ending sequence. This is essentially a convenience function that combines IrSequence and IrSignal constructors.
intro | |
lengthIntro | |
repeat | |
lengthRepeat | |
frequency | |
dutyCycle |
Definition at line 35 of file IrSignal.cpp.
IrSignal::IrSignal | ( | const IrSequence & | intro, |
const IrSequence & | repeat, | ||
const IrSequence & | ending, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Copy constructor.
intro | |
repeat | |
ending | |
frequency | |
dutyCycle |
Definition at line 4 of file IrSignal.cpp.
IrSignal::IrSignal | ( | IrSequence && | intro, |
IrSequence && | repeat, | ||
IrSequence && | ending, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Move constructor.
intro | |
repeat | |
ending | |
frequency | |
dutyCycle |
Definition at line 9 of file IrSignal.cpp.
IrSignal::IrSignal | ( | const IrSequence & | intro, |
const IrSequence & | repeat, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Copy constructors for IrSignals without ending sequence.
intro | |
repeat | |
frequency | |
dutyCycle |
Definition at line 14 of file IrSignal.cpp.
IrSignal::IrSignal | ( | IrSequence && | intro, |
IrSequence && | repeat, | ||
frequency_t | frequency = defaultFrequency , |
||
dutycycle_t | dutyCycle = defaultDutyCycle |
||
) |
Move constructor for IrSignals without ending sequence.
intro | |
repeat | |
frequency | |
dutyCycle |
Definition at line 19 of file IrSignal.cpp.
void IrSignal::dump | ( | Stream & | stream, |
bool | usingSigns = false |
||
) | const |
Print a human readable representation of the IrSignal on the Stream supplied.
stream | Stream onto the output is printed. |
usingSigns | is true, prepend marks with '+' and gaps with '-'. |
Definition at line 68 of file IrSignal.cpp.
|
inline |
If the duty cycle is sensible, print it to the stream and return true.
Otherwise do nothing and return false. No extra spaces or line feeds are generated.
stream | Stream onto the output is printed. |
Definition at line 193 of file IrSignal.h.
|
static |
Static version of dumpDutyCycle.
stream | Stream onto the output is printed. |
dutyCycle |
Definition at line 89 of file IrSignal.cpp.
|
inline |
If the frequency is sensible, print it to the stream and return true.
Otherwise do nothing and return false. No extra spaces or line feeds are generated.
Definition at line 176 of file IrSignal.h.
|
static |
Static version of dumpFrequency.
stream | Stream onto the output is printed. |
frequency | modulation frequency |
Definition at line 80 of file IrSignal.cpp.
|
inline |
Print a human readable representation of the IrSignal on the Stream supplied, using signs.
stream | Stream onto the output is printed. |
Definition at line 167 of file IrSignal.h.
|
inline |
Definition at line 134 of file IrSignal.h.
|
inline |
Definition at line 138 of file IrSignal.h.
|
inline |
Definition at line 130 of file IrSignal.h.
|
inline |
Definition at line 146 of file IrSignal.h.
|
inline |
Definition at line 142 of file IrSignal.h.
|
inline |
Implementation of the count semantics, i.e., how many repetitions should be sent if the signal is sent noSend times.
noSends | number of times to "send signal". |
Definition at line 209 of file IrSignal.h.
|
inline |
True if and only if at least one of the sequences is true (= non-empty).
Definition at line 154 of file IrSignal.h.
|
static |
|
static |
|
staticconstexpr |
Definition at line 16 of file IrSignal.h.
|
staticconstexpr |
Definition at line 13 of file IrSignal.h.
|
staticconstexpr |
Definition at line 14 of file IrSignal.h.
|
staticconstexpr |
Definition at line 15 of file IrSignal.h.
|
staticconstexpr |
Definition at line 17 of file IrSignal.h.