diff --git a/src/protocol.rs b/src/protocol.rs index 9ad1a10..3db8c50 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -171,7 +171,18 @@ pub fn run_tap_command(device: &HidDevice, tap_bytes: &[u8]) -> Result 0x7E { + 1 // Skip non-printable length/status byte + } else { + 0 // Data starts immediately + }; + let result = response_report[data_start..] + .split(|&x| x == 0) + .next() + .unwrap(); Ok(std::str::from_utf8(result) .map_err(|e| Error::ProtocolError(e.into()))?