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.connected Read only Experimental

Một giá trị boolean trả về true trong khi môi trường thực thi script này đang kết nối tới this.device. Giá trị này có thể là false ngay cả khi user agent vẫn đang kết nối vật lý.

BluetoothRemoteGATTServer.device Read 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 BluetoothRemoteGATTService chính do thiết bị Bluetooth cung cấp cho một BluetoothServiceUUID được chỉ định.

BluetoothRemoteGATTServer.getPrimaryServices() Experimental

Trả về một promise cho danh sách các đối tượng BluetoothRemoteGATTService chính do thiết bị Bluetooth cung cấp cho một BluetoothServiceUUID được chỉ định.

Thông số kỹ thuật

Specification
Web Bluetooth
# bluetoothgattremoteserver-interface

Khả năng tương thích của trình duyệt