23 char decodeBuffer[2 *
sizeof (hash) + 1];
29 void decode(
const IrReader& irReader);
35 void decode(
const IrSignal& irSignal) {
41 static constexpr unsigned int offset = 2;
42 static constexpr const char *format =
"%0lx";
43 static constexpr uint32_t FNVprime = 16777619UL;
44 static constexpr uint32_t FNVoffsetBasis = 2166136261UL;
45 static constexpr unsigned int minMeaningfulLength = 4U;
65 sprintf(decodeBuffer, format,
static_cast<unsigned long>(hash));
74 sprintf(decodeBuffer, format,
static_cast<unsigned long>(hash));
79 sprintf(decodeBuffer, format,
static_cast<unsigned long>(hash));
uint16_t microseconds_t
Type for durations in micro seconds.
A decoder class using FNV-1 hashes of length 32.
HashDecoder(const IrSignal &irSignal)
HashDecoder(const IrReader &irReader)
Constructs a HashDecoder from an IrReader, containing data.
uint32_t getHash() const
Returns the hash value.
static bool tryDecode(const IrReader &irReader, Stream &stream)
Convenience function; constructs a HashDecoder and calls its printDecode.
const char * getDecode() const
Returns a textual description the decode for human consumption.
HashDecoder(const IrSequence &irSequence)
Constructs a HashDecoder from an IrSequence.
static uint32_t decodeHash(const IrSequence &irSequence)
Abstract base class for all decoder classes.
Abstract base class for all IR readers, capturing or receiving.
This class consists of a vector of durations.
const microseconds_t * getDurations() const
size_t getLength() const
Returns the number of durations.
This class models an IR signal with intro-, repeat-, and ending sequences.
const IrSequence & getIntro() const
const IrSequence & getRepeat() const
const IrSequence & getEnding() const