From fe484f3003df154433020f052078c13f9e2a236a Mon Sep 17 00:00:00 2001 From: Andy Hinkel Date: Fri, 25 Sep 2026 15:33:39 +0200 Subject: [PATCH] interpret yes, parse no --- src/device.rs | 2 +- src/device_handlers/demo_handler.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/device.rs b/src/device.rs index 8c65f59..3e484b7 100644 --- a/src/device.rs +++ b/src/device.rs @@ -47,5 +47,5 @@ pub trait DeviceHandler: Debug { ) -> Result>; /// Device sent a reply in a mode where no replies are expected: handle it - fn parse_unrequested_device_reply(&mut self, device_reply: &[u8]) -> Result; + fn interpret_unrequested_device_reply(&mut self, device_reply: &[u8]) -> Result; } diff --git a/src/device_handlers/demo_handler.rs b/src/device_handlers/demo_handler.rs index d10e1ec..404ea0c 100644 --- a/src/device_handlers/demo_handler.rs +++ b/src/device_handlers/demo_handler.rs @@ -75,7 +75,7 @@ impl DemoHandler { /// This fn is stateless and as such not implemented as a member fn /// This is needed during parsing, to avoid borrow fails - fn parse_device_reply( + fn interpret_device_reply( reply: &[u8], ) -> crate::device::Result<::Telemetry> { log::warn!("{:?}", reply); @@ -96,7 +96,7 @@ impl DemoHandler { }; // our protocol is simple - // none simple protocols would be parsed here + // none simple protocols would be interpreted here // we only extract the first data byte let data = reply[1]; @@ -188,7 +188,7 @@ impl DeviceHandler for DemoHandler { std::thread::sleep(Duration::from_millis(100)); let reply = interface.read(&mut self.io_buffer)?; - let tm = Self::parse_device_reply(reply)?; + let tm = Self::interpret_device_reply(reply)?; // // There is only one type of telemetry, so if there is one, it is the correct one // let Telemetry::TheOneAndOnlyTelemetry(_) = tm else { @@ -212,11 +212,11 @@ impl DeviceHandler for DemoHandler { } } - fn parse_unrequested_device_reply( + fn interpret_unrequested_device_reply( &mut self, device_reply: &[u8], ) -> crate::device::Result { - Self::parse_device_reply(device_reply) + Self::interpret_device_reply(device_reply) } fn shutdown(