BluetoothUUID: phương thức tĩnh getDescriptor()

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.

Phương thức tĩnh getDescriptor() của giao diện BluetoothUUID trả về một UUID đại diện cho một descriptor đã đăng ký khi truyền vào tên hoặc bí danh UUID 16 bit hay 32 bit.

Cú pháp

js
BluetoothUUID.getDescriptor(name)

Tham số

name

Một chuỗi chứa tên của descriptor.

Giá trị trả về

Một UUID 128 bit.

Ngoại lệ

TypeError

Được ném ra nếu name không xuất hiện trong registry.

Ví dụ

Trong ví dụ sau, UUID đại diện cho descriptor có tên time_trigger_setting được trả về và in ra console.

js
let result = BluetoothUUID.getDescriptor("time_trigger_setting");
console.log(result); // "0000290e-0000-1000-8000-00805f9b34fb"

Thông số kỹ thuật

Thông số kỹ thuật
Web Bluetooth
# dom-bluetoothuuid-getdescriptor

Tương thích trình duyệt