Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67b4c13c authored by Henri Chataing's avatar Henri Chataing
Browse files

uwb/aidl/default: Log incoming and outgoing packet bytes

Bug: 329316454
Test: TreeHugger
Change-Id: I9c9951273ed593a2090d199830a973f013b3da68
parent 1d9bf983
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -230,6 +230,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();
            }
        });
@@ -284,10 +285,13 @@ impl IUwbChipAsyncServer for UwbChip {
        log::debug!("sendUciMessage");

        if let State::Opened { ref mut serial, .. } = &mut *self.state.lock().await {
            serial
            log::debug!(" --> {:?}", data);
            let result = serial
                .write(data)
                .map(|written| written as i32)
                .map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into())
                .map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into());
            log::debug!(" status: {:?}", result);
            result
        } else {
            Err(binder::ExceptionCode::ILLEGAL_STATE.into())
        }