BluetoothUUID

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Web Bluetooth APIBluetoothUUID インターフェイスは、Bluetooth SIG が管理しているレジストリーから Universally Unique Identifier (UUID) の値を名前で検索する方法を提供します。

説明

UUID 文字列は、00001818-0000-1000-8000-00805f9b34fb などの 128 ビットの UUID です。 Bluetooth レジストリーには、16 ビットおよび 32 ビットのエイリアスと名前に加え、UUID で識別されるディスクリプター、サービス、キャラクタリスティックのリストも格納されています。

BluetoothUUID インターフェイスは、これらの 128 ビットの UUID を取得するメソッドを提供します。

静的メソッド

BluetoothUUID.canonicalUUID() Experimental

16 ビットまたは 32 ビットの UUID エイリアスを受け取り、128 ビットの UUID を返します。

BluetoothUUID.getCharacteristic() Experimental

名前、もしくは 16 ビットまたは 32 ビットの UUID エイリアスを受け取り、登録されたキャラクタリスティックを表す 128 ビットの UUID を返します。

BluetoothUUID.getDescriptor() Experimental

名前、もしくは 16 ビットまたは 32 ビットの UUID エイリアスを受け取り、登録されたディスクリプターを表す 128 ビットの UUID を返します。

BluetoothUUID.getService() Experimental

名前、もしくは 16 ビットまたは 32 ビットの UUID エイリアスを受け取り、登録されたサービスを表す 128 ビットの UUID を返します。

この例では、device_information という名前のサービスを表す UUID が返され、コンソールに出力されます。

js
let result = BluetoothUUID.getService("device_information");
console.log(result); // "0000180a-0000-1000-8000-00805f9b34fb"

仕様書

Specification
Web Bluetooth
# bluetoothuuid

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
BluetoothUUID
canonicalUUID() static method
Experimental
getCharacteristic() static method
Experimental
getDescriptor() static method
Experimental
getService() static method
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
Has more compatibility info.