Experimental
Это экспериментальная технология
Так как спецификация этой технологии ещё не стабилизировалась, смотрите таблицу совместимости по поводу использования в различных браузерах. Также заметьте, что синтаксис и поведение экспериментальной технологии может измениться в будущих версиях браузеров, вслед за изменениями спецификации.
Интерфейс 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
BluetoothGATTService
offered by the bluetooth device for a specifiedBluetoothServiceUUID
. BluetoothRemoteGATTServer.getPrimaryServices()
- Returns a promise to a list of primary
BluetoothGATTService
objects offered by the bluetooth device for a specifiedBluetoothServiceUUID
.
Спецификации
Спецификация | Статус | Комментарий |
---|---|---|
Web Bluetooth Определение 'BluetoothRemoteGATTServer' в этой спецификации. |
Черновик | Изначальное определение. |
Совместимость
BCD tables only load in the browser