BluetoothRemoteGATTCharacteristic

Limited availability

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

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

Web Bluetooth APIBluetoothRemoteGattCharacteristic インターフェイスは、GATT キャラクタリスティックを表します。これは、周辺機器のサービスに関する詳細情報を提供する基本的なデータ要素です。

EventTarget BluetoothRemoteGATTCharacteristic

インスタンスプロパティ

BluetoothRemoteGATTCharacteristic.service 読取専用 Experimental

このキャラクタリスティックが属する BluetoothRemoteGATTService を返します。

BluetoothRemoteGATTCharacteristic.uuid 読取専用 Experimental

このキャラクタリスティックの UUID を表す文字列を返します。たとえば、Heart Rate Measurement characteristic は '00002a37-0000-1000-8000-00805f9b34fb' です。

BluetoothRemoteGATTCharacteristic.properties 読取専用 Experimental

このキャラクタリスティックのプロパティを返します。

BluetoothRemoteGATTCharacteristic.value 読取専用 Experimental

現在キャッシュされているキャラクタリスティックの値です。この値は、キャラクタリスティックの値が読まれるか、ノーティフィケーションやインディケーションによって更新されると更新されます。

イベント

oncharacteristicvaluechanged Experimental

characteristicvaluechanged イベント用のイベントハンドラーです。

インスタンスメソッド

BluetoothRemoteGATTCharacteristic.getDescriptor() Experimental

指定のディスクリプター UUID に対応する最初の BluetoothRemoteGATTDescriptor で解決する Promise を返します。

BluetoothRemoteGATTCharacteristic.getDescriptors() Experimental

指定のディスクリプター UUID に対応するすべての BluetoothRemoteGATTDescriptor オブジェクトの Array で解決する Promise を返します。

BluetoothRemoteGATTCharacteristic.readValue() Experimental

利用可能で対応していれば、value プロパティの複製が格納された DataView で解決する Promise を返します。そうでない場合は、エラーを投げます。

BluetoothRemoteGATTCharacteristic.writeValue(value) 非推奨;

value プロパティを渡された ArrayBuffer に格納されたバイト列に設定し、WriteCharacteristicValue(this=this, value=value, response="optional") を呼び出し、結果の Promise を返します。

BluetoothRemoteGATTCharacteristic.writeValueWithResponse(value) Experimental

value プロパティを渡された ArrayBuffer に格納されたバイト列に設定し、WriteCharacteristicValue(this=this, value=value, response="required") を呼び出し、結果の Promise を返します。

BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse(value) Experimental

value プロパティを渡された ArrayBuffer に格納されたバイト列に設定し、WriteCharacteristicValue(this=this, value=value, response="never") を呼び出し、結果の Promise を返します。

BluetoothRemoteGATTCharacteristic.startNotifications() Experimental

navigator.bluetooth が活動中のノーティフィケーションコンテキストに追加されたら解決する Promise を返します。

BluetoothRemoteGATTCharacteristic.stopNotifications() Experimental

navigator.bluetooth が活動中のノーティフィケーションコンテキストから削除されたら解決する Promise を返します。

仕様書

Specification
Web Bluetooth
# bluetoothgattcharacteristic-interface

ブラウザーの互換性

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
BluetoothRemoteGATTCharacteristic
Experimental
characteristicvaluechanged event
Experimental
getDescriptor
Experimental
getDescriptors
Experimental
properties
Experimental
readValue
Experimental
service
Experimental
startNotifications
Experimental
stopNotifications
Experimental
uuid
Experimental
value
Experimental
writeValue
Deprecated
writeValueWithResponse
Experimental
writeValueWithoutResponse
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.
Deprecated. Not for use in new websites.
See implementation notes.
Has more compatibility info.