Trait infrared::receiver::ProtocolDecoder
source · pub trait ProtocolDecoder<Mono: InfraMonotonic, Cmd> {
fn event(&mut self, edge: bool, dt: Mono::Duration) -> State;
fn command(&self) -> Option<Cmd>;
fn reset(&mut self);
fn spans(&self) -> &PulseSpans<Mono>;
fn event_total(
&mut self,
edge: bool,
dt: Mono::Duration
) -> Result<Option<Cmd>, DecodingError> { ... }
}
Expand description
Protocol decode state machine
Required Methods§
sourcefn event(&mut self, edge: bool, dt: Mono::Duration) -> State
fn event(&mut self, edge: bool, dt: Mono::Duration) -> State
Notify the state machine of a new event
edge
: true = positive edge, false = negative edgedt
: Duration since last event
sourcefn command(&self) -> Option<Cmd>
fn command(&self) -> Option<Cmd>
Get the command Returns the data if State == Done, otherwise None
sourcefn spans(&self) -> &PulseSpans<Mono>
fn spans(&self) -> &PulseSpans<Mono>
Get the time spans
Provided Methods§
sourcefn event_total(
&mut self,
edge: bool,
dt: Mono::Duration
) -> Result<Option<Cmd>, DecodingError>
fn event_total(
&mut self,
edge: bool,
dt: Mono::Duration
) -> Result<Option<Cmd>, DecodingError>
I don’t care about the details, just give me a command (or an error)!