This page was translated from English by the community. Learn more and join the MDN Web Docs community.
BluetoothRemoteGATTServer
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Экспериментальная возможность: Это экспериментальная технология
Так как спецификация этой технологии ещё не стабилизировалась, смотрите таблицу совместимости по поводу использования в различных браузерах. Также заметьте, что синтаксис и поведение экспериментальной технологии может измениться в будущих версиях браузеров, вслед за изменениями спецификации.
Интерфейс BluetoothRemoteGATTServer, относящийся к Web Bluetooth API, представляет сервер GATT на удалённом устройстве.
Примечание:
Данная страница описывает Web Bluetooth API от W3C Community Group. BluetoothGattServer (Firefox OS) - Bluetooth API в Firefox OS.
Интерфейс
interface BluetoothRemoteGATTServer {
readonly attribute BluetoothDevice device;
readonly attribute boolean connected;
Promise<BluetoothRemoteGATTServer> connect();
void disconnect();
Promise<BluetoothRemoteGATTService> getPrimaryService(BluetoothServiceUUID service);
Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices(optional BluetoothServiceUUID service);
};
Свойства
BluetoothRemoteGATTServer.connectedТолько для чтения-
Двоичное значение, равное
true, если устройствоthis.deviceподключено. It can be false while the user agent is physically connected. BluetoothRemoteGATTServer.deviceТолько для чтения-
BluetoothDevice, на котором работает сервер.
Методы
BluetoothRemoteGATTServer.connect()-
Подключение к устройству
this.device. BluetoothRemoteGATTServer.disconnect()-
Отключение от устройства
this.device. BluetoothRemoteGATTServer.getPrimaryService()-
Returns a promise to the primary
BluetoothGATTServiceoffered by the bluetooth device for a specifiedBluetoothServiceUUID. BluetoothRemoteGATTServer.getPrimaryServices()-
Returns a promise to a list of primary
BluetoothGATTServiceobjects offered by the bluetooth device for a specifiedBluetoothServiceUUID.
Спецификации
| Specification |
|---|
| Web Bluetooth> # bluetoothgattremoteserver-interface> |
Совместимость с браузерами
Enable JavaScript to view this browser compatibility table.