BluetoothRemoteGATTCharacteristic

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

ブラウザーの互換性

BCD tables only load in the browser