Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
com.systemic.bluetoothle.Scanner Class Reference

Static class with methods for running a Bluetooth Low Energy (BLE) scan. More...

Classes

interface  ScannerCallback
 Interface for scan results callbacks. More...
 

Static Public Member Functions

static void startScan (final String servicesUuids, final ScannerCallback callback)
 Starts scanning for BLE peripherals advertising the given list of services.
 
static void stopScan ()
 Stops an on-going BLE scan.
 

Detailed Description

Static class with methods for running a Bluetooth Low Energy (BLE) scan.

Note
This class was designed to work in a Unity plugin and its marshaling mechanism, and as such the advertisement data returned by a scan is passed as JSON string rather than a complex object.

It relies on Nordic's Android-Scanner-Compat-Library library for most of the work.

See also
https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library

Member Function Documentation

◆ startScan()

static void com.systemic.bluetoothle.Scanner.startScan ( final String  servicesUuids,
final ScannerCallback  callback 
)
static

Starts scanning for BLE peripherals advertising the given list of services.

If a scan is already running, it is stopped before starting the new one.

Parameters
servicesUuidsComma separated list of services UUIDs. Peripherals advertising at least one of the services will be reported. Notify for all peripherals if the list is null or empty.
callbackThe callback for notifying of the scan results (called for each advertisement packet).

The documentation for this class was generated from the following file: