implement sync write

This commit is contained in:
Max Känner 2024-01-02 18:43:45 +01:00
parent f912c03661
commit f265a6a153

View File

@ -192,11 +192,12 @@ impl<'a> Instruction<'a> {
buffer[4..4 + ids.len()].copy_from_slice(ids); buffer[4..4 + ids.len()].copy_from_slice(ids);
Ok(4 + u16::try_from(ids.len()).map_err(|_| Error::Unknown)?) Ok(4 + u16::try_from(ids.len()).map_err(|_| Error::Unknown)?)
} }
SyncWrite { SyncWrite { addr, len, data } if buffer.len() >= 4 + data.len() => {
addr: _, buffer[..2].copy_from_slice(&addr.to_le_bytes());
len: _, buffer[2..4].copy_from_slice(&len.to_le_bytes());
data: _, buffer[4..4 + data.len()].copy_from_slice(data);
} => unimplemented!(), Ok(4 + u16::try_from(data.len()).map_err(|_| Error::Unknown)?)
}
BulkRead { data: _ } => unimplemented!(), BulkRead { data: _ } => unimplemented!(),
BulkWrite { data: _ } => unimplemented!(), BulkWrite { data: _ } => unimplemented!(),
FastBulkRead { data: _ } => unimplemented!(), FastBulkRead { data: _ } => unimplemented!(),