这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

This page describes the W3C Community Group BluetoothRemoteGATTService, formerly called BluethoothGATTService. For the Firefox OS interface of the same name, see BluetoothGattService .

BluetoothRemoteGATTService 接口在 Web Bluetooth API represents a service provided by a GATT server, including a device, a list of referenced services, and a list of the characteristics of this service.

接口

interface BluetoothRemoteGATTService : ServiceEventHandlers {
  readonly attribute UUID uuid;
  readonly attribute boolean isPrimary;
  readonly attribute BluetoothDevice device;
  Promise<BluetoothGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic);
  Promise<sequence<BluetoothGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic);
  Promise<BluetoothGATTService> getIncludedService(BluetoothServiceUUID service);
  Promise<sequence<BluetoothGATTService>> getIncludedServices(optional BluetoothServiceUUID service);
};
					

特性

BluetoothRemoteGATTService.device 只读
Returns information about a Bluetooth device through an instance of BluetoothDevice .
BluetoothRemoteGATTService.isPrimary 只读
返回 布尔 Indicating whether this is a primary or secondary service.
BluetoothRemoteGATTService.uuid 只读
返回 DOMString representing the UUID of this service.

方法

BluetoothRemoteGATTService.getCharacteristic()
返回 Promise to an instance of BluetoothGATTCharacteristic for a given universally unique identifier (UUID).
BluetoothRemoteGATTService.getCharacteristics()
返回 Promise to an 数组 of BluetoothGATTCharacteristic instances for an optional universally unique identifier (UUID).
BluetoothRemoteGATTService.getIncludedService()
返回 Promise to an instance of BluetoothRemoteGATTService for a given universally unique identifier (UUID).
BluetoothRemoteGATTService.getIncludedServices()
返回 Promise to an 数组 of BluetoothRemoteGATTService instances for an optional universally unique identifier (UUID).

规范

规范 状态 注释
Web Bluetooth
The definition of 'BluetoothRemoteGATTService' in that specification.
草案 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
BluetoothRemoteGATTService Chrome 56
56
macOS only.
56 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
70
Windows 10.
Edge ≤79
≤79
macOS only.
≤79 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
≤79
Windows 10.
Firefox No IE No Opera 43
43
macOS only.
43 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 43: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
57
Windows 10.
Safari No WebView Android No Chrome Android 56 Firefox Android No Opera Android 43 Safari iOS No Samsung Internet Android 6.0
device Chrome No Edge No Firefox No IE No Opera 43
43
macOS only.
43 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 43: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
57
Windows 10.
Safari No WebView Android No Chrome Android No Firefox Android No Opera Android 43 Safari iOS No Samsung Internet Android No
getCharacteristic Chrome 56
56
macOS only.
56 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
70
Windows 10.
Edge ≤79
≤79
macOS only.
≤79 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
≤79
Windows 10.
Firefox No IE No Opera 43
43
macOS only.
43 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 43: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
57
Windows 10.
Safari No WebView Android No Chrome Android 56 Firefox Android No Opera Android 43 Safari iOS No Samsung Internet Android 6.0
getCharacteristics Chrome No Edge No Firefox No IE No Opera Yes Safari No WebView Android No Chrome Android No Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android No
getIncludedService Chrome No Edge No Firefox No IE No Opera ? Safari No WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS No Samsung Internet Android No
getIncludedServices Chrome 56
56
macOS only.
56 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
70
Windows 10.
Edge ≤79
≤79
macOS only.
≤79 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
≤79
Windows 10.
Firefox No IE No Opera 43
43
macOS only.
43 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 43: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
57
Windows 10.
Safari No WebView Android No Chrome Android 56 Firefox Android No Opera Android 43 Safari iOS No Samsung Internet Android 6.0
isPrimary Chrome No Edge No Firefox No IE No Opera Yes Safari No WebView Android No Chrome Android No Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android No
uuid Chrome 56
56
macOS only.
56 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
70
Windows 10.
Edge ≤79
≤79
macOS only.
≤79 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
≤79
Windows 10.
Firefox No IE No Opera 43
43
macOS only.
43 Disabled
Linux and versions of Windows earlier than 10.
Disabled From version 43: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled ).
57
Windows 10.
Safari No WebView Android No Chrome Android 56 Firefox Android No Opera Android 43 Safari iOS No Samsung Internet Android 6.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

元数据

  • 最后修改:
  1. BluetoothRemoteGATTService
  2. 特性
    1. device
    2. getCharacteristic()
    3. getCharacteristics()
    4. getIncludedService()
    5. getIncludedServices()
    6. isPrimary
    7. uuid

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1