Skip to content
Damian edited this page Jul 26, 2022 · 1 revision

Welcome to the Linux.Bluetooth wiki!

Usage Samples

Get a Bluetooth adapter

using Linux.Bluetooth;
...

// Get the first adapter (useful for a single BLE adapter system)
IAdapter1 adapter = (await BlueZManager.GetAdaptersAsync()).FirstOrDefault();

// Get specific adapter
IAdapter1 adapter = await BlueZManager.GetAdapterAsync(adapterName: "hci0");

Scan for Bluetooth devices

adapter.DeviceFound += adapter_DeviceFoundAsync;

await adapter.StartDiscoveryAsync();
...
await adapter.StopDiscoveryAsync();
Clone this wiki locally