B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent: Difference between revisions
< B2G | Bluetooth | WebBluetooth-v2
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Overview == | == Overview == | ||
'''BluetoothLeDeviceEvent''' is carried as the parameter of | '''BluetoothLeDeviceEvent''' is carried as the parameter of event handler [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDiscoveryHandle#ondevicefound|discoveryHandle.ondevicefound]]. Applications can get the [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#BluetoothDevice|BluetoothDevice]] object, RSSI value, and advertisement record of the found remote LE device. | ||
== Interface == | == Interface == | ||
| Line 6: | Line 6: | ||
interface BluetoothLeDeviceEvent : Event | interface BluetoothLeDeviceEvent : Event | ||
{ | { | ||
readonly attribute [B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#BluetoothDevice|BluetoothDevice]] | readonly attribute [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#BluetoothDevice|BluetoothDevice]] [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDeviceEvent#device|device]]; | ||
readonly attribute short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#rssi|rssi]]; | readonly attribute short [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#rssi|rssi]]; | ||
readonly attribute ArrayBuffer [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#scanRecord|scanRecord]]; | readonly attribute ArrayBuffer [[B2G/Bluetooth/WebBluetooth-v2/BluetoothLeDeviceEvent#scanRecord|scanRecord]]; | ||
Latest revision as of 01:57, 10 September 2014
Overview
BluetoothLeDeviceEvent is carried as the parameter of event handler discoveryHandle.ondevicefound. Applications can get the BluetoothDevice object, RSSI value, and advertisement record of the found remote LE device.
Interface
[CheckPermissions="bluetooth"]
interface BluetoothLeDeviceEvent : Event
{
readonly attribute BluetoothDevice device;
readonly attribute short rssi;
readonly attribute ArrayBuffer scanRecord;
};
Properties
device
- Description
- The found remote LE device.
- Value type
- BluetoothDevice
rssi
- Description
- The RSSI value for the remote LE device as reported by the bluetooth hardware. 0 if no RSSI value is available.
- Value type
- short
scanRecord
- Description
- The content of the advertisement record offered by the remote LE device.
- Value type
- ArrayBuffer