Skip to content

Commit

Permalink
add write_fb
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Nguyen committed Jun 4, 2024
1 parent 1d6e9cc commit 7eadb18
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ pub trait Protocol<P: Packet> {
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<Vec<u8>> {
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,
Expand Down

0 comments on commit 7eadb18

Please sign in to comment.