rust/bt-common: Add debug events and background tasks

Add event streaming, dynamic background stream management, and a debug
harness to bt-common.

Debug tools often need to continuously run background work and deliver
messages and/or structured events, instead of only doing work
only when commands are sent.

Add Event to the CommandRunner trait and a method to set persistent
streams which will be polled in the background and can deliver messages
or structured events using RunnerEvent.  Events are optional but each
CommandRunner implementation myst at least define type Event = ()

RunnerBackground<E> manages dynamic keyed or anonymous background streams,
display messages, and structured events.

Test: cargo test --workspace
Change-Id: I2200a0d21a679d0e2f6d380c5156213c6a6a6964
Reviewed-on: https://bluetooth-review.googlesource.com/c/bluetooth/+/4141
5 files changed
tree: b903c8add2d7e784a20c494568b167fb592ddc93
  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)