uwb/aidl/default: Use write_all instead of write in sendUciMessage

write_all ensures that the full buffer is being written.

Bug: 329316454
Test: TreeHugger
Change-Id: I422445aff32cdeba8fba9497a4296e6eda2e60ce
This commit is contained in:
Henri Chataing 2024-03-14 18:44:40 +00:00
parent 67b4c13cf7
commit cd3a3402b5

View file

@ -287,8 +287,8 @@ impl IUwbChipAsyncServer for UwbChip {
if let State::Opened { ref mut serial, .. } = &mut *self.state.lock().await {
log::debug!(" --> {:?}", data);
let result = serial
.write(data)
.map(|written| written as i32)
.write_all(data)
.map(|_| data.len() as i32)
.map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into());
log::debug!(" status: {:?}", result);
result