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

A decoder class using FNV-1 hashes of length 32. More...

#include <HashDecoder.h>

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

Public Member Functions

virtual ~HashDecoder ()
 
 HashDecoder (const IrReader &irReader)
 Constructs a HashDecoder from an IrReader, containing data. More...
 
 HashDecoder (const IrSequence &irSequence)
 Constructs a HashDecoder from an IrSequence. More...
 
 HashDecoder (const IrSignal &irSignal)
 
uint32_t getHash () const
 Returns the hash value. More...
 
const char * getDecode () const
 Returns a textual description the decode for human consumption. More...
 
- Public Member Functions inherited from IrDecoder
 IrDecoder ()
 
virtual ~IrDecoder ()
 
virtual const char * getDecode () const =0
 Returns a textual description the decode for human consumption. More...
 
virtual bool isValid () const
 Returns true if the decode was successful. More...
 
 operator bool () const
 Same as isValid(). More...
 
bool printDecode (Stream &stream) const
 If valid, prints the decode to the stream. More...
 

Static Public Member Functions

static uint32_t decodeHash (const IrSequence &irSequence)
 
static uint32_t decodeHash (const IrReader &irReader)
 
static bool tryDecode (const IrReader &irReader, Stream &stream)
 Convenience function; constructs a HashDecoder and calls its printDecode. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IrDecoder
void setValid (bool valid_)
 
- Static Protected Member Functions inherited from IrDecoder
static bool isEnding (microseconds_t duration)
 Tests if the argument is large enough to be considered an ending of a decodable signal. More...
 
- Static Protected Attributes inherited from IrDecoder
static constexpr int invalid = -1
 

Detailed Description

A decoder class using FNV-1 hashes of length 32.

This is not a decoder in the proper sense of the word, but instead computes a hash value from the IrSequence. For different IrSequences, this will, with high probability, be different.

Definition at line 19 of file HashDecoder.h.

Constructor & Destructor Documentation

◆ ~HashDecoder()

virtual HashDecoder::~HashDecoder ( )
inlinevirtual

Definition at line 57 of file HashDecoder.h.

◆ HashDecoder() [1/3]

HashDecoder::HashDecoder ( const IrReader irReader)
inline

Constructs a HashDecoder from an IrReader, containing data.

Parameters
irReaderIrReader with data, i.e. with isReady() true.

Definition at line 63 of file HashDecoder.h.

◆ HashDecoder() [2/3]

HashDecoder::HashDecoder ( const IrSequence irSequence)
inline

Constructs a HashDecoder from an IrSequence.

Parameters
irSequence

Definition at line 72 of file HashDecoder.h.

◆ HashDecoder() [3/3]

HashDecoder::HashDecoder ( const IrSignal irSignal)
inline

Definition at line 77 of file HashDecoder.h.

Member Function Documentation

◆ decodeHash() [1/2]

uint32_t HashDecoder::decodeHash ( const IrReader irReader)
static

Definition at line 45 of file HashDecoder.cpp.

◆ decodeHash() [2/2]

uint32_t HashDecoder::decodeHash ( const IrSequence irSequence)
static

Definition at line 40 of file HashDecoder.cpp.

◆ getDecode()

const char * HashDecoder::getDecode ( ) const
inlinevirtual

Returns a textual description the decode for human consumption.

Returns
decode as text.

Implements IrDecoder.

Definition at line 102 of file HashDecoder.h.

◆ getHash()

uint32_t HashDecoder::getHash ( ) const
inline

Returns the hash value.

Returns
uint32_t

Definition at line 86 of file HashDecoder.h.

◆ tryDecode()

bool HashDecoder::tryDecode ( const IrReader irReader,
Stream &  stream 
)
static

Convenience function; constructs a HashDecoder and calls its printDecode.

Parameters
irReaderIrReader to use
streamStream
Returns
success of operation

Definition at line 10 of file HashDecoder.cpp.


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