Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IrSequenceReader Class Reference

This class packs an IrSequence into a dummy, immutable IrReader. More...

#include <IrSequenceReader.h>

Inheritance diagram for IrSequenceReader:
Inheritance graph
[legend]
Collaboration diagram for IrSequenceReader:
Collaboration graph
[legend]

Public Member Functions

 IrSequenceReader ()
 
 IrSequenceReader (const IrSequenceReader &orig)
 
 IrSequenceReader (IrSequenceReader &&orig)
 
 IrSequenceReader (const IrSequence &irSequence_)
 
virtual ~IrSequenceReader ()
 
virtual frequency_t getFrequency () const
 Returns frequency of received signal. More...
 
void receive ()
 Convenience function: enable, wait until data is collected or timeout has occured, disable. More...
 
bool isReady () const
 Returns true if there is collected data. More...
 
size_t getDataLength () const
 Returns the number of collected durations. More...
 
microseconds_t getDuration (unsigned int index) const
 Returns the index-th duration, if possible. More...
 
- Public Member Functions inherited from IrReader
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...
 
IrSequencetoIrSequence () 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...
 

Additional Inherited Members

- Static Public Attributes inherited from IrReader
static constexpr milliseconds_t defaultBeginningTimeout = 2000U
 
static constexpr milliseconds_t defaultEndingTimeout = 30U
 
static constexpr size_t defaultCaptureLength = 100U
 
- Protected Member Functions inherited from IrReader
 IrReader (size_t bufSize_)
 Constructs an IrReader with buffersize bufSize_, possibly increased to be even. More...
 
 IrReader ()
 
virtual ~IrReader ()
 
- Static Protected Member Functions inherited from IrReader
static unsigned int forceEven (unsigned int x)
 
- Protected Attributes inherited from IrReader
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...
 

Detailed Description

This class packs an IrSequence into a dummy, immutable IrReader.

It is basically intended for debugging and such.

Definition at line 10 of file IrSequenceReader.h.

Constructor & Destructor Documentation

◆ IrSequenceReader() [1/4]

IrSequenceReader::IrSequenceReader ( )
inline

Definition at line 15 of file IrSequenceReader.h.

◆ IrSequenceReader() [2/4]

IrSequenceReader::IrSequenceReader ( const IrSequenceReader orig)
inline

Definition at line 18 of file IrSequenceReader.h.

◆ IrSequenceReader() [3/4]

IrSequenceReader::IrSequenceReader ( IrSequenceReader &&  orig)
inline

Definition at line 21 of file IrSequenceReader.h.

◆ IrSequenceReader() [4/4]

IrSequenceReader::IrSequenceReader ( const IrSequence irSequence_)
inline

Definition at line 24 of file IrSequenceReader.h.

◆ ~IrSequenceReader()

virtual IrSequenceReader::~IrSequenceReader ( )
inlinevirtual

Definition at line 27 of file IrSequenceReader.h.

Member Function Documentation

◆ getDataLength()

size_t IrSequenceReader::getDataLength ( ) const
inlinevirtual

Returns the number of collected durations.

Returns
number durations

Implements IrReader.

Definition at line 41 of file IrSequenceReader.h.

◆ getDuration()

microseconds_t IrSequenceReader::getDuration ( unsigned int  index) const
inlinevirtual

Returns the index-th duration, if possible.

Parameters
indexindex of duration
Returns
requested duration

Implements IrReader.

Definition at line 45 of file IrSequenceReader.h.

◆ getFrequency()

virtual frequency_t IrSequenceReader::getFrequency ( ) const
inlinevirtual

Returns frequency of received signal.

This is a dumb default implementation, to be overridden when meaningful.

Returns
frequency

Implements IrReader.

Definition at line 30 of file IrSequenceReader.h.

◆ isReady()

bool IrSequenceReader::isReady ( ) const
inlinevirtual

Returns true if there is collected data.

Returns
status

Implements IrReader.

Definition at line 37 of file IrSequenceReader.h.

◆ receive()

void IrSequenceReader::receive ( )
inlinevirtual

Convenience function: enable, wait until data is collected or timeout has occured, disable.

Implements IrReader.

Definition at line 34 of file IrSequenceReader.h.


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