Arduino PulseWire Transceiver Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
pulsewire::Preamble Class Referenceabstract

Abstract base class for preamble detection and generation. More...

#include <Preamble.h>

Inheritance diagram for pulsewire::Preamble:
Inheritance graph
[legend]
Collaboration diagram for pulsewire::Preamble:
Collaboration graph
[legend]

Public Member Functions

virtual bool begin (uint16_t bitFrequencyHz)
 
void reset ()
 
virtual bool detect (const OutputEdge &edge)
 Detects if the incoming edge matches the expected preamble pattern.
 
virtual int getEdges (pulsewire::Vector< pulsewire::OutputEdge > &output) const =0
 Returns the expected preamble edges for this protocol.
 
virtual size_t preambleLength () const =0
 
bool inRange (uint32_t value, uint32_t target, uint32_t tolerance) const
 

Protected Attributes

pulsewire::Vector< pulsewire::OutputEdge_history
 
pulsewire::Vector< pulsewire::OutputEdge_expected
 

Detailed Description

Abstract base class for preamble detection and generation.

Provides an interface for detecting protocol-specific preambles in incoming pulse streams and generating preamble edges for transmission. This allows Codec classes to use different preamble detection strategies without coupling to specific implementations.

Definition at line 40 of file Preamble.h.

Member Function Documentation

◆ begin()

virtual bool pulsewire::Preamble::begin ( uint16_t  bitFrequencyHz)
inlinevirtual

Definition at line 44 of file Preamble.h.

◆ detect()

virtual bool pulsewire::Preamble::detect ( const OutputEdge edge)
inlinevirtual

Detects if the incoming edge matches the expected preamble pattern.

Reimplemented in pulsewire::IRMultiProtocol, and pulsewire::NoPreamble.

Definition at line 52 of file Preamble.h.

◆ getEdges()

virtual int pulsewire::Preamble::getEdges ( pulsewire::Vector< pulsewire::OutputEdge > &  output) const
pure virtual

Returns the expected preamble edges for this protocol.

Implemented in pulsewire::NoPreamble, pulsewire::IRProtocol, pulsewire::IRMultiProtocol, and pulsewire::CustomPreambleUs.

◆ inRange()

bool pulsewire::Preamble::inRange ( uint32_t  value,
uint32_t  target,
uint32_t  tolerance 
) const
inline

Utility function to check if a value is within a specified tolerance range of a target

Definition at line 95 of file Preamble.h.

◆ preambleLength()

virtual size_t pulsewire::Preamble::preambleLength ( ) const
pure virtual

◆ reset()

void pulsewire::Preamble::reset ( )
inline

Definition at line 49 of file Preamble.h.

Field Documentation

◆ _expected

pulsewire::Vector<pulsewire::OutputEdge> pulsewire::Preamble::_expected
protected

Definition at line 102 of file Preamble.h.

◆ _history

pulsewire::Vector<pulsewire::OutputEdge> pulsewire::Preamble::_history
protected

Definition at line 101 of file Preamble.h.


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