BluetoothUUID:canonicalUUID() 靜態方法
BluetoothUUID 介面的 canonicalUUID() 靜態方法在傳入 16 位或 32 位 UUID 別名時,會返回 128 位 UUID。
語法
js
BluetoothUUID.canonicalUUID(alias)
引數
別名-
包含 16 位或 32 位 UUID 別名的字串。
返回值
一個 128 位 UUID。
示例
在下面的示例中,由別名 0x110A 表示的 UUID 被返回並列印到控制檯。
js
let result = BluetoothUUID.canonicalUUID("0x110A");
console.log(result); // "0000110a-0000-1000-8000-00805f9b34fb"
規範
| 規範 |
|---|
| Web 藍牙 # dom-bluetoothuuid-canonicaluuid |
瀏覽器相容性
載入中…