From 7eadb18dbedff4a78841000afa8d600c19c67289 Mon Sep 17 00:00:00 2001 From: Steve Nguyen Date: Tue, 4 Jun 2024 17:14:21 +0200 Subject: [PATCH] add write_fb --- src/protocol/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index d3e6741..7d10b1e 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -31,6 +31,17 @@ pub trait Protocol { self.send_instruction_packet(port, P::write_packet(id, addr, data).as_ref())?; self.read_status_packet(port, id).map(|_| ()) } + fn write_fb( + &self, + port: &mut dyn SerialPort, + id: u8, + addr: u8, + data: &[u8], + ) -> Result> { + self.send_instruction_packet(port, P::write_packet(id, addr, data).as_ref())?; + self.read_status_packet(port, id) + .map(|sp| sp.params().to_vec()) + } fn sync_read( &self, port: &mut dyn SerialPort,