Infrared4Arduino
|
Abstract base class for all IR readers, capturing or receiving. More...
#include <IrReader.h>
Public Member Functions | |
virtual void | reset () |
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 boolean | isReady () const =0 |
Returns true if there is collected data. 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 boolean | 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 const milliseconds_t | defaultBeginningTimeout = 2000U |
static const milliseconds_t | defaultEndingTimeout = 30U |
static const 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... | |
boolean | 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 63 of file IrReader.h.
|
inlinevirtual |
Stop reception of IR data.
Reimplemented in IrReceiverSampler, and IrReceiverPoll.
Definition at line 80 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 IrReceiverSampler, and IrReceiverPoll.
Definition at line 74 of file IrReader.h.
|
inlinestaticprotected |
Definition at line 49 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverSampler, and IrReceiverPoll.
Definition at line 135 of file IrReader.h.
|
inline |
Definition at line 139 of file IrReader.h.
|
pure virtual |
Returns the number of collected durations.
Implemented in IrReceiverSampler, IrWidget, IrSequenceReader, and IrReceiverPoll.
|
pure virtual |
Returns the index-th duration, if possible.
index | index of duration |
Implemented in IrReceiverSampler, IrWidget, IrSequenceReader, and IrReceiverPoll.
|
inlinevirtual |
Reimplemented in IrReceiverSampler, IrWidget, and IrReceiverPoll.
Definition at line 127 of file IrReader.h.
|
inline |
Gets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to the off.durations.
Definition at line 157 of file IrReader.h.
|
inlinevirtual |
Definition at line 119 of file IrReader.h.
|
pure virtual |
Returns true if there is collected data.
Implemented in IrReceiverSampler, IrWidget, IrSequenceReader, and IrReceiverPoll.
|
pure virtual |
Convenience function: enable, wait until data is collected or timeout has occured, disable.
Implemented in IrWidget, IrReceiver, and IrSequenceReader.
|
inlinevirtual |
Reimplemented in IrReceiverSampler, IrWidget, and IrReceiverPoll.
Definition at line 67 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverSampler, and IrReceiverPoll.
Definition at line 131 of file IrReader.h.
|
inlinevirtual |
Reimplemented in IrReceiverSampler, IrWidget, and IrReceiverPoll.
Definition at line 123 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 148 of file IrReader.h.
IrSequence * IrReader::toIrSequence | ( | ) | const |
Generates an IrSequence from the IrReader.
Definition at line 32 of file IrReader.cpp.
|
protected |
Definition at line 38 of file IrReader.h.
|
protected |
Definition at line 41 of file IrReader.h.
|
static |
Definition at line 33 of file IrReader.h.
|
static |
Definition at line 35 of file IrReader.h.
|
static |
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.