Infrared4Arduino 1.2.3
|
Abstract base class for all IR readers, capturing or receiving. More...
#include <IrReader.h>
Public Member Functions | |
virtual void | reset () |
virtual frequency_t | getFrequency () const =0 |
Returns frequency of received signal. More... | |
virtual void | enable () |
Start reception of IR data. More... | |
virtual void | disable () |
Stop reception of IR data. More... | |
virtual void | receive ()=0 |
Convenience function: enable, wait until data is collected or timeout has occured, disable. More... | |
virtual bool | isReady () const =0 |
Returns true if there is collected data. More... | |
operator bool () const | |
Same as isReady() More... | |
virtual size_t | getDataLength () const =0 |
Returns the number of collected durations. More... | |
virtual microseconds_t | getDuration (unsigned int index) const =0 |
Returns the index-th duration, if possible. More... | |
virtual void | dump (Stream &stream) const |
Prints a textual representation of the received data to the Stream supplied. More... | |
IrSequence * | toIrSequence () const |
Generates an IrSequence from the IrReader. More... | |
virtual bool | isEmpty () const |
virtual void | setEndingTimeout (milliseconds_t timeOut) |
virtual milliseconds_t | getEndingTimeout () const |
virtual void | setBeginningTimeout (milliseconds_t timeOut) |
virtual milliseconds_t | getBeginningTimeout () const |
unsigned int | getBufferSize () const |
void | setMarkExcess (int16_t markExcess_) |
Sets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations. More... | |
int16_t | getMarkExcess () const |
Gets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations. More... | |
Static Public Attributes | |
static constexpr milliseconds_t | defaultBeginningTimeout = 2000U |
static constexpr milliseconds_t | defaultEndingTimeout = 30U |
static constexpr size_t | defaultCaptureLength = 100U |
Protected Member Functions | |
IrReader (size_t bufSize_) | |
Constructs an IrReader with buffersize bufSize_, possibly increased to be even. More... | |
IrReader () | |
virtual | ~IrReader () |
Static Protected Member Functions | |
static unsigned int | forceEven (unsigned int x) |
Protected Attributes | |
milliseconds_t | beginningTimeout |
milliseconds_t | endingTimeout |
size_t | bufferSize |
int16_t | markExcess |
Microseconds subtracted from pulses and added to gaps. More... | |
bool | timeouted |
True if last receive ended with a timeout. More... | |
Abstract base class for all IR readers, capturing or receiving.
It should also serve as an interface description, allowing for received data to be printed and decoded.
Definition at line 30 of file IrReader.h.
|
inlineprotected |
Constructs an IrReader with buffersize bufSize_, possibly increased to be even.
bufSize_ |
Definition at line 57 of file IrReader.h.
|
inlineprotected |
Definition at line 60 of file IrReader.h.
|
inlineprotectedvirtual |
Definition at line 70 of file IrReader.h.
|
inlinevirtual |
Stop reception of IR data.
Reimplemented in IrReceiverPoll, and IrReceiverSampler.
Definition at line 94 of file IrReader.h.
|
virtual |
Prints a textual representation of the received data to the Stream supplied.
stream | Stream to which to print |
Reimplemented in IrWidget.
Definition at line 21 of file IrReader.cpp.
|
inlinevirtual |
Start reception of IR data.
Reimplemented in IrReceiverPoll, and IrReceiverSampler.
Definition at line 88 of file IrReader.h.
|
inlinestaticprotected |
Definition at line 49 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverPoll, and IrReceiverSampler.
Definition at line 157 of file IrReader.h.
|
inline |
Definition at line 161 of file IrReader.h.
|
pure virtual |
Returns the number of collected durations.
Implemented in IrReceiverPoll, IrReceiverSampler, IrSequenceReader, and IrWidget.
|
pure virtual |
Returns the index-th duration, if possible.
index | index of duration |
Implemented in IrReceiverPoll, IrReceiverSampler, IrWidget, and IrSequenceReader.
|
inlinevirtual |
Reimplemented in IrReceiverPoll, IrReceiverSampler, and IrWidget.
Definition at line 149 of file IrReader.h.
|
pure virtual |
Returns frequency of received signal.
This is a dumb default implementation, to be overridden when meaningful.
Implemented in IrReceiver, IrSequenceReader, and IrWidget.
|
inline |
Gets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations.
Definition at line 179 of file IrReader.h.
|
inlinevirtual |
Definition at line 141 of file IrReader.h.
|
pure virtual |
Returns true if there is collected data.
Implemented in IrReceiverPoll, IrReceiverSampler, IrSequenceReader, and IrWidget.
|
inline |
|
pure virtual |
Convenience function: enable, wait until data is collected or timeout has occured, disable.
Implemented in IrReceiver, IrSequenceReader, and IrWidget.
|
inlinevirtual |
Reimplemented in IrReceiverPoll, IrReceiverSampler, and IrWidget.
Definition at line 74 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverPoll, and IrReceiverSampler.
Definition at line 153 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverPoll, IrReceiverSampler, and IrWidget.
Definition at line 145 of file IrReader.h.
|
inline |
Sets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations.
markExcess_ | possibly negative new value |
Definition at line 170 of file IrReader.h.
IrSequence * IrReader::toIrSequence | ( | ) | const |
Generates an IrSequence from the IrReader.
Definition at line 31 of file IrReader.cpp.
|
protected |
Definition at line 38 of file IrReader.h.
|
protected |
Definition at line 41 of file IrReader.h.
|
staticconstexpr |
Definition at line 33 of file IrReader.h.
|
staticconstexpr |
Definition at line 35 of file IrReader.h.
|
staticconstexpr |
Definition at line 34 of file IrReader.h.
|
protected |
Definition at line 39 of file IrReader.h.
|
protected |
Microseconds subtracted from pulses and added to gaps.
May be negative.
Definition at line 44 of file IrReader.h.
|
protected |
True if last receive ended with a timeout.
Definition at line 47 of file IrReader.h.