From d5b5f10a3a5a51067c15e51768c0a464a991a4fe Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Tue, 6 Feb 2024 21:25:27 +0100 Subject: [PATCH] nec: debug: Add repeat state to NecDebugCmd Add repeat flag to the Nec debug cmd to allow differentiating between a repeat press and all 0 bits. --- src/protocol/nec/raw.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protocol/nec/raw.rs b/src/protocol/nec/raw.rs index dfe0d6d..2a55fc1 100644 --- a/src/protocol/nec/raw.rs +++ b/src/protocol/nec/raw.rs @@ -7,6 +7,7 @@ use crate::protocol::nec::{NecCommandVariant, NecPulseLen, NEC_STANDARD_TIMING}; /// Nec Command without parsing of bit meaning pub struct NecDebugCmd { pub bits: u32, + pub repeat: bool, } impl NecCommandVariant for NecDebugCmd { @@ -16,8 +17,8 @@ impl NecCommandVariant for NecDebugCmd { true } - fn unpack(bits: u32, _repeat: bool) -> Option { - Some(NecDebugCmd { bits }) + fn unpack(bits: u32, repeat: bool) -> Option { + Some(NecDebugCmd { bits, repeat }) } fn pack(&self) -> u32 {