50 return (x & 1) ? x + 1 : x;
92 virtual boolean isReady()
const = 0;
111 virtual void dump(Stream &stream)
const;
124 endingTimeout = timeOut;
132 beginningTimeout = timeOut;
149 markExcess = markExcess_;
virtual void setBeginningTimeout(milliseconds_t timeOut)
static const milliseconds_t defaultBeginningTimeout
uint16_t microseconds_t
Type for durations in micro seconds.
static const milliseconds_t defaultEndingTimeout
void setMarkExcess(int16_t markExcess_)
Sets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to...
virtual microseconds_t getDuration(unsigned int index) const =0
Returns the index-th duration, if possible.
virtual void enable()
Start reception of IR data.
virtual size_t getDataLength() const =0
Returns the number of collected durations.
virtual void disable()
Stop reception of IR data.
virtual boolean isEmpty() const
uint16_t milliseconds_t
Type for durations in milli seconds.
unsigned int getBufferSize() const
int16_t getMarkExcess() const
Gets the markExcess, a number (possibly negative) to be subtracted from the on-durations and added to...
Abstract base class for all IR readers, capturing or receiving.
virtual void dump(Stream &stream) const
Prints a textual representation of the received data to the Stream supplied.
boolean timeouted
True if last receive ended with a timeout.
virtual milliseconds_t getBeginningTimeout() const
virtual void setEndingTimeout(milliseconds_t timeOut)
milliseconds_t endingTimeout
IrReader(size_t bufSize_)
Constructs an IrReader with buffersize bufSize_, possibly increased to be even.
IrSequence * toIrSequence() const
Generates an IrSequence from the IrReader.
milliseconds_t beginningTimeout
This class consists of a vector of durations.
static const size_t defaultCaptureLength
This file defines some general data types that are used in the library.
static unsigned int forceEven(unsigned int x)
int16_t markExcess
Microseconds subtracted from pulses and added to gaps.
virtual boolean isReady() const =0
Returns true if there is collected data.
virtual milliseconds_t getEndingTimeout() const
virtual void receive()=0
Convenience function: enable, wait until data is collected or timeout has occured, disable.