|
Arduino PulseWire Transceiver Library
|
IRMultiProtocol: Handles detection and delegation for multiple IR protocols. More...
#include <IRProtocol.h>


Public Member Functions | |
| IRMultiProtocol (IRProtocol &defaultInfo) | |
| IRProtocolEnum | getProtocolID () const override |
| Returns the protocol enum identifier for this IR protocol. | |
| int | getEdges (Vector< OutputEdge > &output) const override |
| Returns the preamble edges for this protocol. | |
| size_t | preambleLength () const override |
| Returns the number of edges in the preamble. | |
| uint32_t | frequency () const |
| Returns the carrier frequency in Hz. | |
| size_t | dataLength () const |
| Returns the expected data length in bytes (not including preamble) | |
| uint32_t | shortPulseUs () const |
| Returns the duration of the short pulse in microseconds. | |
| uint32_t | longPulseUs () const |
| Returns the duration of the long pulse in microseconds. | |
| uint32_t | toleranceUs () const |
| Tolerance in microseconds for pulse duration matching during detection. | |
| void | copyFrom (const IRProtocol &other) |
| void | begin (IRProtocolEnum proto, uint32_t frequency, size_t dataLength, uint32_t shortPulse, uint32_t longPulse, uint32_t tolerance, Vector< OutputEdge > edges) |
| bool | detect (const OutputEdge &edge) override |
| Detects if the incoming edge matches the expected preamble pattern. | |
| void | setCallback (void(*callback)(IRProtocolEnum, IRProtocol &, void *ref), void *ref) |
| IRProtocol & | getProtocol () const |
| Provides the active protocol. | |
| IRProtocol & | getProtocolByID (IRProtocolEnum proto) const |
| Provides a protocol by its enum ID, or a default if not found. | |
| void | addProtocol (IRProtocol &protocol) |
| void | setActualProtocol (IRProtocol &proto) |
| void | begin (IRProtocolEnum proto, uint32_t frequency, size_t dataLength, uint32_t shortPulse, uint32_t longPulse, uint32_t tolerance, Vector< OutputEdge > edges, CodecEnum codecType=CodecEnum::PulseDistance) |
| Set all fields for this IR protocol, including preamble edges. | |
| virtual bool | begin (uint16_t bitFrequencyHz) |
| const char * | name () const |
| virtual Codec & | codec () |
| Provides the codec associated with this protocol. | |
| void | reset () |
| bool | inRange (uint32_t value, uint32_t target, uint32_t tolerance) const |
Protected Attributes | |
| IRProtocol * | _refInfo = &IRProtocolNEC |
| Vector< IRProtocol * > | _preambles |
| void(* | _callback )(IRProtocolEnum, IRProtocol &, void *ref) = nullptr |
| void * | _ref = nullptr |
| pulsewire::Vector< pulsewire::OutputEdge > | _history |
| pulsewire::Vector< pulsewire::OutputEdge > | _expected |
IRMultiProtocol: Handles detection and delegation for multiple IR protocols.
This class manages a collection of known IR protocol definitions and attempts to detect which protocol is present in an incoming signal. It delegates all IR protocol-specific method calls to a reference protocol instance (_refInfo), which is updated upon successful detection. This allows seamless switching and handling of multiple IR protocols within a single interface. The class also supports callback registration for protocol detection events.
Definition at line 316 of file IRProtocol.h.
|
inline |
Definition at line 318 of file IRProtocol.h.
|
inline |
Definition at line 340 of file IRProtocol.h.
|
inline |
Definition at line 398 of file IRProtocol.h.
|
inline |
Definition at line 358 of file IRProtocol.h.
|
inlineinherited |
Set all fields for this IR protocol, including preamble edges.
Definition at line 148 of file IRProtocol.h.
Definition at line 44 of file Preamble.h.
Provides the codec associated with this protocol.
Definition at line 205 of file IRProtocol.h.
|
inline |
Definition at line 357 of file IRProtocol.h.
|
inlinevirtual |
Returns the expected data length in bytes (not including preamble)
Reimplemented from pulsewire::IRProtocol.
Definition at line 351 of file IRProtocol.h.
|
inlineoverridevirtual |
Detects if the incoming edge matches the expected preamble pattern.
Reimplemented from pulsewire::Preamble.
Definition at line 365 of file IRProtocol.h.
|
inlinevirtual |
Returns the carrier frequency in Hz.
Reimplemented from pulsewire::IRProtocol.
Definition at line 350 of file IRProtocol.h.
|
inlineoverridevirtual |
Returns the preamble edges for this protocol.
Reimplemented from pulsewire::IRProtocol.
Definition at line 346 of file IRProtocol.h.
|
inline |
Provides the active protocol.
Definition at line 385 of file IRProtocol.h.
|
inline |
Provides a protocol by its enum ID, or a default if not found.
Definition at line 388 of file IRProtocol.h.
|
inlineoverridevirtual |
Returns the protocol enum identifier for this IR protocol.
Reimplemented from pulsewire::IRProtocol.
Definition at line 343 of file IRProtocol.h.
|
inlineinherited |
Utility function to check if a value is within a specified tolerance range of a target
Definition at line 95 of file Preamble.h.
|
inlinevirtual |
Returns the duration of the long pulse in microseconds.
Reimplemented from pulsewire::IRProtocol.
Definition at line 353 of file IRProtocol.h.
Definition at line 182 of file IRProtocol.h.
|
inlineoverridevirtual |
Returns the number of edges in the preamble.
Reimplemented from pulsewire::IRProtocol.
Definition at line 349 of file IRProtocol.h.
|
inlineinherited |
Definition at line 49 of file Preamble.h.
|
inline |
Definition at line 409 of file IRProtocol.h.
|
inline |
You can registre a callback that will be executed when the protocol changes
Definition at line 378 of file IRProtocol.h.
|
inlinevirtual |
Returns the duration of the short pulse in microseconds.
Reimplemented from pulsewire::IRProtocol.
Definition at line 352 of file IRProtocol.h.
|
inlinevirtual |
Tolerance in microseconds for pulse duration matching during detection.
Reimplemented from pulsewire::IRProtocol.
Definition at line 354 of file IRProtocol.h.
|
protected |
Definition at line 419 of file IRProtocol.h.
|
protectedinherited |
Definition at line 102 of file Preamble.h.
|
protectedinherited |
Definition at line 101 of file Preamble.h.
|
protected |
Definition at line 418 of file IRProtocol.h.
Definition at line 420 of file IRProtocol.h.
|
protected |
Definition at line 417 of file IRProtocol.h.