B2G/Bluetooth/WebBluetooth-v2/BluetoothDiscoveryHandle: Difference between revisions
< B2G | Bluetooth | WebBluetooth-v2
Jump to navigation
Jump to search
| Line 18: | Line 18: | ||
: aDeviceEvent | : aDeviceEvent | ||
:: The event can be either | :: The event can be either | ||
:: | :: - a [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#Interface|BluetoothDeviceEvent]] (for BluetoothDiscoveryHandle returned from [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startDiscovery.28.29|adapter.startDiscovery()]]) with property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#device|device]] as the discovered remote bluetooth device, or | ||
:: | :: - a [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#Interface|BluetoothLeDeviceEvent]] (for BluetoothDiscoveryHandle returned from [[B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#startLeScan.28sequence.3CDOMString.3E_aUuids.29|adapter.startLeScan()]]) with property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#device|device]] as the found remote LE device, property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#rssi|rssi]] as the RSSI value, and property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#scanRecord|scanRecord]] as the content of advertisement record. | ||
Latest revision as of 10:36, 21 August 2014
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.