Beispiel #1
0
 /// <summary>
 /// Return whether device is currently scanning for devices.
 /// </summary>
 public static bool IsScanning()
 {
     return(BluetoothService.IsScanning());
 }
Beispiel #2
0
 /// <summary>
 /// Calls the callback method when Bluetooth adapter status changes
 /// </summary>
 /// <param name="callback">Called when status changed</param>
 public static void OnAdapterChanged(Action callback)
 {
     BluetoothService.OnAdapterChanged(callback);
 }
Beispiel #3
0
 /// <summary>
 /// Calls the callback method when Bluetooth adapter state changes to ready
 /// </summary>
 /// <param name="callback">Called when adapter is ready</param>
 public static void WhenAdapterReady(Action callback)
 {
     BluetoothService.WhenAdapterReady(callback);
 }
Beispiel #4
0
 /// <summary>
 /// Get a BLEDevice based on the UUID
 /// </summary>
 /// <param name="uuid">Uuid of the BLEDevice</param>
 /// <returns></returns>
 public static async Task <BLEDevice> GetKnownDevice(Guid uuid)
 {
     return(await BluetoothService.GetKnownDevice(uuid));
 }
Beispiel #5
0
 /// <summary>
 /// Stops scanning for devices
 /// </summary>
 public static void StopScanning()
 {
     BluetoothService.StopScanning();
 }
Beispiel #6
0
 /// <summary>
 /// Scan for BLEDevices that are not yet connected.
 /// </summary>
 /// <exception cref="System.Exception">Throws exception when trying to start scan when a scan is already running.</exception>
 /// <param name="callback">Called when a device is found</param>
 /// <returns>List of IScanResult</returns>
 public static bool StartScanning(Action <BLEScanResult> callback)
 {
     return(BluetoothService.StartScanning(callback));
 }