BluetoothRemoteGATTService

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 BluetoothRemoteGATTService của Web Bluetooth API biểu diễn một dịch vụ do máy chủ GATT cung cấp, bao gồm một thiết bị, một danh sách các dịch vụ được tham chiếu và một danh sách các đặc tính của dịch vụ này.

EventTarget BluetoothRemoteGATTService

Thuộc tính thể hiện

BluetoothRemoteGATTService.device Read only Experimental

Trả về thông tin về một thiết bị Bluetooth thông qua một thể hiện của BluetoothDevice.

BluetoothRemoteGATTService.isPrimary Read only Experimental

Trả về một giá trị boolean cho biết đây là dịch vụ chính hay dịch vụ phụ.

BluetoothRemoteGATTService.uuid Read only Experimental

Trả về một chuỗi biểu diễn UUID của dịch vụ này.

Phương thức thể hiện

BluetoothRemoteGATTService.getCharacteristic() Experimental

Trả về một Promise tới một thể hiện của BluetoothRemoteGATTCharacteristic cho một mã định danh duy nhất toàn cục (UUID) đã cho.

BluetoothRemoteGATTService.getCharacteristics() Experimental

Trả về một Promise tới một Array các thể hiện BluetoothRemoteGATTCharacteristic cho một mã định danh duy nhất toàn cục (UUID) tùy chọn.

Thông số kỹ thuật

Specification
Web Bluetooth
# bluetoothgattservice-interface

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