bluetooth_le 0.2.0 copy "bluetooth_le: ^0.2.0" to clipboard
bluetooth_le: ^0.2.0 copied to clipboard

Cross-platform Bluetooth Low Energy (GATT) for Dart and Flutter, with a GATT-as-serial channel. Pure-Dart CLI plus Flutter on macOS, Linux, Android, iOS, and Windows.

example/README.md

bluetooth_le CLI example #

A pure-Dart command-line demo of bluetooth_le — no Flutter required.

dart pub get
dart run bin/ble.dart doctor                 # adapter state / support check
dart run bin/ble.dart scan                   # scan for advertising devices
dart run bin/ble.dart scan --service 6e400001-b5a3-f393-e0a9-e50e24dcca9e
dart run bin/ble.dart connect <DEVICE-ID>    # open as a serial link (Nordic UART)

<DEVICE-ID> is what scan prints — a MAC address on Linux/Windows, or an opaque identifier on macOS. connect discovers services, treats a write+notify characteristic pair as a serial channel (Nordic UART by default; override with --service/--write/--notify), prints everything received, and sends each line you type.

On macOS, build and run as a native executable so the CoreBluetooth code asset is compiled by the build hook:

dart build cli
./build/cli/bin/ble doctor

See bin/ble.dart for the source.

0
likes
160
points
116
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Cross-platform Bluetooth Low Energy (GATT) for Dart and Flutter, with a GATT-as-serial channel. Pure-Dart CLI plus Flutter on macOS, Linux, Android, iOS, and Windows.

Homepage
Repository (GitHub)
View/report issues

Topics

#bluetooth #ble #gatt #ffi

License

BSD-3-Clause (license)

Dependencies

code_assets, dbus, ffi, hooks, logging, meta, native_toolchain_c

More

Packages that depend on bluetooth_le