bluez 0.0.0-dev.2 copy "bluez: ^0.0.0-dev.2" to clipboard
bluez: ^0.0.0-dev.2 copied to clipboard

outdated

Provides a client to connect to BlueZ - the Linux Bluetooth stack.

example/example.dart

import 'package:dbus/dbus.dart';
import 'package:bluez/bluez.dart';

void main() async {
  var systemBus = DBusClient.system();
  var client = BlueZClient(systemBus);
  await client.connect();

  if (client.adapters.isEmpty) {
    print('No Bluetooth adapters found');
    await systemBus.close();
    return;
  }
  var adapter = client.adapters[0];

  print('Searching for devices on ${adapter.name}...');
  for (var device in client.devices) {
    print('  ${device.name}');
  }
  client.deviceAddedStream.listen((device) => print('  ${device.name}'));

  await adapter.startDiscovery();

  await Future.delayed(Duration(seconds: 5));

  await adapter.stopDiscovery();

  await systemBus.close();
}
37
likes
0
pub points
84%
popularity

Publisher

verified publishercanonical.com

Provides a client to connect to BlueZ - the Linux Bluetooth stack.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dbus

More

Packages that depend on bluez