Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
IrSequenceReader.h
Go to the documentation of this file.
1#pragma once
2
3#include "IrSignal.h"
4#include "IrReader.h"
5
10class IrSequenceReader : public IrReader {
11private:
12 IrSequence irSequence;
13
14public:
15 IrSequenceReader() : irSequence() {
16 };
17
18 IrSequenceReader(const IrSequenceReader& orig) : IrReader(),irSequence(orig.irSequence) {
19 };
20
21 IrSequenceReader(IrSequenceReader&& orig) : IrReader(),irSequence(orig.irSequence) {
22 };
23
24 IrSequenceReader(const IrSequence& irSequence_) : IrReader(),irSequence(irSequence_) {
25 };
26
28 };
29
30 virtual frequency_t getFrequency() const {
32 };
33
34 void receive() {
35 };
36
37 bool isReady() const {
38 return true;
39 };
40
41 size_t getDataLength() const {
42 return irSequence.getLength();
43 };
44
45 microseconds_t getDuration(unsigned int index) const {
46 return irSequence[index];
47 };
48};
uint16_t microseconds_t
Type for durations in micro seconds.
Definition: InfraredTypes.h:15
uint32_t frequency_t
Type for modulation frequency in Hz.
Definition: InfraredTypes.h:31
Abstract base class for all IR readers, capturing or receiving.
Definition: IrReader.h:30
This class packs an IrSequence into a dummy, immutable IrReader.
microseconds_t getDuration(unsigned int index) const
Returns the index-th duration, if possible.
IrSequenceReader(const IrSequence &irSequence_)
virtual frequency_t getFrequency() const
Returns frequency of received signal.
virtual ~IrSequenceReader()
bool isReady() const
Returns true if there is collected data.
IrSequenceReader(IrSequenceReader &&orig)
size_t getDataLength() const
Returns the number of collected durations.
void receive()
Convenience function: enable, wait until data is collected or timeout has occured,...
IrSequenceReader(const IrSequenceReader &orig)
This class consists of a vector of durations.
Definition: IrSequence.h:11
size_t getLength() const
Returns the number of durations.
Definition: IrSequence.h:65
static constexpr frequency_t defaultFrequency
Definition: IrSignal.h:13