# bluetooth_cli
A thin command-line binary over [`bluetooth_core`](../bluetooth_core) for
driving real Bluetooth hardware directly, without Dart or Flutter. It is the
quickest way to confirm that BLE works on a host.
## Commands
```sh
cargo run --manifest-path native/bluetooth_cli/Cargo.toml -- permission
cargo run --manifest-path native/bluetooth_cli/Cargo.toml -- scan [seconds]
cargo run --manifest-path native/bluetooth_cli/Cargo.toml -- info <id> [seconds]
```
- permission: print the Bluetooth authorization status, requesting it (and
prompting the user) if it has not been determined.
- scan: scan for nearby BLE devices for the given number of seconds (default 5)
and print them deduplicated and sorted by signal strength.
- info: scan to find a peripheral by id, connect to it, and print its services
and characteristics.
From the repo root you can also run a scan via melos:
```sh
dart run melos run native:scan
```
On macOS the first run triggers the system Bluetooth permission prompt; allow
it so scanning can proceed.