B2G/Bluetooth/WebBluetooth-v2/BluetoothDiscoveryHandle

From MozillaWiki
Jump to: navigation, search

Overview

BluetoothDiscoveryHandle is used to notify application of discovered remote bluetooth device. Its event handler ondevicefound is fired each time a remote bluetooth device is discovered.

Interface

[CheckPermissions="bluetooth"]
interface BluetoothDiscoveryHandle: EventTarget {
  attribute EventHandler ondevicefound;
}

Event Handler

ondevicefound

Description
A event handler to trigger each time a remote bluetooth device is discovered.
Parameter
aDeviceEvent
The event can be either
- a BluetoothDeviceEvent (for BluetoothDiscoveryHandle returned from adapter.startDiscovery()) with property device as the discovered remote bluetooth device, or
- a BluetoothLeDeviceEvent (for BluetoothDiscoveryHandle returned from adapter.startLeScan()) with property device as the found remote LE device, property rssi as the RSSI value, and property scanRecord as the content of advertisement record.