Version: Smart Feature Phone 2.5
BluetoothDevice
Description#
The BluetoothDevice interface of the Bluetooth API provides information regarding a given Bluetooth device.
Interface overview#
Properties#
BluetoothDevice.addressread-onlyA string representing the address of the device on the Bluetooth micro-network.BluetoothDevice.codread-onlyReturns a BluetoothClassOfDevice object containing information about the device's capabilities.BluetoothDevice.gattread-onlyReturns a BluetoothGatt object that allows JavaScript to conduct GATT client operations on a remote LE device. This property will return null for devices of type classic or unknown.BluetoothDevice.nameread-onlyThe human readable name of the device.BluetoothDevice.pairedread-onlyA boolean indicating if the device is paired to the adapter (true) or not (false).BluetoothDevice.typeread-onlyReturns the device type of the remote device.BluetoothDevice.uuidsread-onlyAn Array of strings indicating the UUIDs of each Bluetooth service the device is able to provide.
Event handlers#
BluetoothDevice.onattributechangedDefines a handler for the attributechanged event; triggers when a remote device's properties have changed (has a BluetoothAttributeEvent as a parameter.)
Methods#
BluetoothDevice.fetchUuidsFetches the up-to-date UUID list of services that the device provides. If the fetchUuids operation succeeds, an onattributechanged would be triggered right before the Promise is resolved to indicate device.uuids has changed.
BluetoothDevice by Mozilla Contributors is licensed under CC-BY-SA 2.5.