Skip to main content

simpledartble 1.4.0 copy "simpledartble: ^1.4.0" to clipboard
simpledartble: ^1.4.0 copied to clipboard

SimpleBLE for Dart. Discover and connect Bluetooth peripherals, read and write GATT values, subscribe to notifications, and host local GATT services through one API.

example/simpledartble_example.dart

// Scans for five seconds with the first adapter and prints the peripherals it
// finds. The repository's examples/simpledartble folder has an example for each
// operation: https://github.com/simpleble/simpleble/tree/main/examples/simpledartble
import 'package:simpledartble/simpledartble.dart';

Future<void> main() async {
  final adapter = (await Adapter.getAdapters()).first;
  print('Using ${adapter.identifier} [${adapter.address}]');

  adapter.onScanFound.listen((peripheral) {
    print('Found ${peripheral.identifier} [${peripheral.address}] ${peripheral.rssi} dBm');
  });
  await adapter.scanFor(const Duration(seconds: 5));
}
0
likes
145
points
1.09k
downloads

Documentation

Documentation
API reference

Publisher

verified publishersimpleble.org

Weekly Downloads

SimpleBLE for Dart. Discover and connect Bluetooth peripherals, read and write GATT values, subscribe to notifications, and host local GATT services through one API.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#bluetooth #ble #ffi

License

unknown (license)

Dependencies

code_assets, ffi, hooks, meta

More

Packages that depend on simpledartble