BluetoothRemoteGATTServer

Khả dụng hạn chế

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 Thử nghiệm

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 Thử nghiệm

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() Thử nghiệm

Khiến môi trường thực thi script kết nối tới this.device.

BluetoothRemoteGATTServer.disconnect() Thử nghiệm

Khiến môi trường thực thi script ngắt kết nối khỏi this.device.

BluetoothRemoteGATTServer.getPrimaryService() Thử nghiệm

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() Thử nghiệm

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

Thông số kỹ thuật
Web Bluetooth
# bluetoothgattremoteserver-interface

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