rust/bt-pacs: Add debug logging to PACS
Add debug! and trace! logging to PACS characteristic decoding and
reading to improve visibility into audio capability handling.
Debugging PACS against a real peer requires seeing what was read from
each characteristic and how it was interpreted; without it a malformed
record is indistinguishable from a missing one.
- Log PAC record decoding, including record counts and codec ids
- Log audio location and audio context decoding results
- Add try_read implementations that log the handle being read and the
number of bytes returned, sharing a read_characteristic_value
helper that handles truncated reads
- Implement Decodable for AudioContexts and log the decoded contexts
- Depend on the log crate
- Add unit tests for Verbose and -v/-vv flags in the debug CLI
Test: cargo test -p bt-pacs
cargo test --workspace
Change-Id: I5187de3d249bf40d68ffe11ce11012516a6a6964
Reviewed-on: https://bluetooth-review.googlesource.com/c/bluetooth/+/4121
This is a repository for shared libraries and tools that can be useful for multiple Bluetooth stacks.
These tools and libraries are meant to be:
It has been started as a repository for developing Rust crates but can be easily expanded to include libraries and tools written in other languages.
It is not a full Bluetooth stack. Google has two officially open-source Bluetooth stacks: