BLE Manager


The adapter is where everything begins and ends. Unlike the platform implementations of the adapter scan, the BLE plugin Scan() method will scan continuously (or restart the scan when the cycle completes) until you dispose of the Scan() token.


Monitor and read status of adapter

// current status

// monitor status changes
BleManager.WhenStatusChanged().Subscribe(status => {});

Scan for Devices

var scanner = CrossBleAdapter.Current.Scan().Subscribe(scanResult => 
    // do something with it
    // the scanresult contains the device, RSSI, and advertisement packet

scanner.Dispose(); // to stop scanning

Scan for Devices - Advanced

    new ScanConfig 
        ServiceUuids = { new Guid("<your guid here>") }
.Subscribe(scanResult => 

General Scan

var scan = CentralManager.Scan().Subscribe(scanResult => {});

// to stop scan 

Specific Scans

Find a named peripheral

// this will return a single result and complete - you can await it if you want
var peripheral = CentralManager.ScanForPeripheral("YourDevice");

var peripheral = CentralManager.ScanForPeripheral(YourDevice);

Change Adapter State (Power on/off)

Supported by Android only

if (CrossBleAdapter.Current.CanChangeAdapterState)
    CrossBleAdapter.Current.SetAdapterState(true); // or false to disable

Get Connected Devices

var devices = CrossBleAdapter.Current.GetConnectedDevices();
foreach (var device in devices)
    // do something


// this essentially recreates the scan cycles like on Android
CrossBleAdapter.Current.ScanInterval(TimeSpan).Subscribe(scanResult => {});

Toggle State of Adapter

// returns true if successful