このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

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 読取専用

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

BluetoothRemoteGATTCharacteristic.uuid 読取専用

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

BluetoothRemoteGATTCharacteristic.properties 読取専用

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

BluetoothRemoteGATTCharacteristic.value 読取専用

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

イベント

oncharacteristicvaluechanged

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

インスタンスメソッド

BluetoothRemoteGATTCharacteristic.getDescriptor()

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

BluetoothRemoteGATTCharacteristic.getDescriptors()

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

BluetoothRemoteGATTCharacteristic.readValue()

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

BluetoothRemoteGATTCharacteristic.writeValue(value)

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

BluetoothRemoteGATTCharacteristic.writeValueWithResponse(value)

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

BluetoothRemoteGATTCharacteristic.writeValueWithoutResponse(value)

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

BluetoothRemoteGATTCharacteristic.startNotifications()

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

BluetoothRemoteGATTCharacteristic.stopNotifications()

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

仕様書

Specification
Web Bluetooth
# bluetoothgattcharacteristic-interface

ブラウザーの互換性