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
4 files changed
tree: 717fd9ce8a1b018a614f7247a6764aa09669c4cd
  1. .agents/
  2. docs/
  3. infra/
  4. rust/
  5. .gitignore
  6. AUTHORS
  7. CONTRIBUTING.md
  8. GEMINI.md
  9. LICENSE
  10. OWNERS
  11. PATENTS
  12. presubmit.sh
  13. README.md
README.md

Bluetooth Shared Libraries

What is this?

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:

  • Stack-agnostic and platform-agnostic
  • Implement a useful subset of a published Bluetooth specification.

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.

What is this not?

It is not a full Bluetooth stack. Google has two officially open-source Bluetooth stacks:

Structure

  • rust - Rust Crates
  • docs - General documentation (documentation for each library/tool is included in their directories)