BluetoothRemoteGATTServer
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Giao diện BluetoothRemoteGATTServer của Web Bluetooth API biểu diễn một máy chủ GATT trên một thiết bị từ xa.
Thuộc tính thể hiện
BluetoothRemoteGATTServer.connectedRead only Experimental-
Một giá trị boolean trả về
truetrong khi môi trường thực thi script này đang kết nối tớithis.device. Giá trị này có thể làfalsengay cả khi user agent vẫn đang kết nối vật lý. BluetoothRemoteGATTServer.deviceRead only Experimental-
Một tham chiếu tới
BluetoothDeviceđang chạy máy chủ này.
Phương thức thể hiện
BluetoothRemoteGATTServer.connect()Experimental-
Khiến môi trường thực thi script kết nối tới
this.device. BluetoothRemoteGATTServer.disconnect()Experimental-
Khiến môi trường thực thi script ngắt kết nối khỏi
this.device. BluetoothRemoteGATTServer.getPrimaryService()Experimental-
Trả về một promise cho
BluetoothRemoteGATTServicechính do thiết bị Bluetooth cung cấp cho mộtBluetoothServiceUUIDđược chỉ định. BluetoothRemoteGATTServer.getPrimaryServices()Experimental-
Trả về một promise cho danh sách các đối tượng
BluetoothRemoteGATTServicechính do thiết bị Bluetooth cung cấp cho mộtBluetoothServiceUUIDđược chỉ định.
Thông số kỹ thuật
| Specification |
|---|
| Web Bluetooth> # bluetoothgattremoteserver-interface> |