BluetoothUUID
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
TheBluetoothUUID interface of theWeb Bluetooth API provides a way to look up Universally Unique Identifier (UUID) values by name in theregistry maintained by the Bluetooth SIG.
In this article
Description
A UUID string is a 128-bit UUID, for example00001818-0000-1000-8000-00805f9b34fb.The Bluetooth registry contains lists of descriptors, services, and characteristics identified by these UUIDs in addition to a 16- or 32- bit alias, and a name.
TheBluetoothUUID interface provides methods to retrieve these 128-bit UUIDs.
Static methods
BluetoothUUID.canonicalUUID()ExperimentalReturns the 128-bit UUID when passed the 16- or 32-bit UUID alias.
BluetoothUUID.getCharacteristic()ExperimentalReturns the 128-bit UUID representing a registered characteristic when passed a name or the 16- or 32-bit UUID alias.
BluetoothUUID.getDescriptor()ExperimentalReturns a UUID representing a registered descriptor when passed a name or the 16- or 32-bit UUID alias.
BluetoothUUID.getService()ExperimentalReturns a UUID representing a registered service when passed a name or the 16- or 32-bit UUID alias.
Examples
In the following example the UUID representing the service nameddevice_information is returned and printed to the console.
let result = BluetoothUUID.getService("device_information");console.log(result); // "0000180a-0000-1000-8000-00805f9b34fb"Specifications
| Specification |
|---|
| Web Bluetooth> # bluetoothuuid> |