mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 20:24:19 +00:00
Merge changes I422445af,I9c995127 into main
* changes: uwb/aidl/default: Use write_all instead of write in sendUciMessage uwb/aidl/default: Log incoming and outgoing packet bytes
This commit is contained in:
@@ -241,6 +241,7 @@ impl IUwbChipAsyncServer for UwbChip {
|
||||
// Read the payload bytes.
|
||||
read_exact(reader.get_mut(), &mut buffer[UWB_HEADER_SIZE..]).unwrap();
|
||||
|
||||
log::debug!(" <-- {:?}", buffer);
|
||||
client_callbacks.onUciMessage(&buffer).unwrap();
|
||||
}
|
||||
});
|
||||
@@ -295,10 +296,13 @@ impl IUwbChipAsyncServer for UwbChip {
|
||||
log::debug!("sendUciMessage");
|
||||
|
||||
if let State::Opened { ref mut serial, .. } = &mut *self.state.lock().await {
|
||||
serial
|
||||
.write(data)
|
||||
.map(|written| written as i32)
|
||||
.map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into())
|
||||
log::debug!(" --> {:?}", data);
|
||||
let result = serial
|
||||
.write_all(data)
|
||||
.map(|_| data.len() as i32)
|
||||
.map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into());
|
||||
log::debug!(" status: {:?}", result);
|
||||
result
|
||||
} else {
|
||||
Err(binder::ExceptionCode::ILLEGAL_STATE.into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user