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

View in English Always switch to English

BluetoothRemoteGATTServer

Limited availability

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

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

Web Bluetooth APIBluetoothRemoteGATTServer インターフェイスは、リモートデバイス上の GATT サーバーを表します。

インスタンスプロパティ

BluetoothRemoteGATTServer.connected 読取専用

このスクリプト実行環境が this.device に接続されている間 true を返す論理値です。ユーザーエージェントが物理的に接続されていても false になる可能性があります。

BluetoothRemoteGATTServer.device 読取専用

このサーバーを動かしている BluetoothDevice への参照です。

インスタンスメソッド

BluetoothRemoteGATTServer.connect()

このスクリプト実行環境を this.device に接続させます。

BluetoothRemoteGATTServer.disconnect()

このスクリプト実行環境を this.device から切断させます。

BluetoothRemoteGATTServer.getPrimaryService()

Bluetooth デバイスが提供している指定の BluetoothServiceUUID に対応するプライマリー BluetoothRemoteGATTService で解決するプロミスを返します。

BluetoothRemoteGATTServer.getPrimaryServices()

Bluetooth デバイスが提供している指定の BluetoothServiceUUID に対応するプライマリー BluetoothRemoteGATTService オブジェクトのリストで解決するプロミスを返します。

仕様書

Specification
Web Bluetooth
# bluetoothgattremoteserver-interface

ブラウザーの互換性