You need to sign in or sign up before continuing.
提交 b3e3e5b3 编写于 作者: A annie_wangli

update docs

Signed-off-by: Nannie_wangli <annie.wangli@huawei.com>
上级 150bbd26
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> >
> The Bluetooth module provides Classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising. > The Bluetooth module provides Classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
...@@ -24,8 +24,6 @@ ohos.permission.DISCOVER_BLUETOOTH ...@@ -24,8 +24,6 @@ ohos.permission.DISCOVER_BLUETOOTH
ohos.permission.LOCATION ohos.permission.LOCATION
## bluetooth.enableBluetooth<sup>8+</sup><a name="enableBluetooth"></a> ## bluetooth.enableBluetooth<sup>8+</sup><a name="enableBluetooth"></a>
enableBluetooth(): boolean enableBluetooth(): boolean
...@@ -38,8 +36,8 @@ Enables Bluetooth. ...@@ -38,8 +36,8 @@ Enables Bluetooth.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ------------------------ |
| boolean | Returns **true** if Bluetooth is enabled; returns **false** otherwise.| | boolean | Returns **true** if Bluetooth is enabled; returns **false** otherwise.|
**Example** **Example**
...@@ -61,8 +59,8 @@ Disables Bluetooth. ...@@ -61,8 +59,8 @@ Disables Bluetooth.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ------------------------ |
| boolean | Returns **true** if Bluetooth is disabled; returns **false** otherwise.| | boolean | Returns **true** if Bluetooth is disabled; returns **false** otherwise.|
**Example** **Example**
...@@ -84,8 +82,8 @@ Obtains the name of the local Bluetooth device. ...@@ -84,8 +82,8 @@ Obtains the name of the local Bluetooth device.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------ | --------- |
| string | Name of the local Bluetooth device obtained.| | string | Name of the local Bluetooth device obtained.|
**Example** **Example**
...@@ -107,8 +105,8 @@ Obtains the Bluetooth state. ...@@ -107,8 +105,8 @@ Obtains the Bluetooth state.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | --------------------------------- | --------- |
| [BluetoothState](#bluetoothstate) | Bluetooth state obtained.| | [BluetoothState](#bluetoothstate) | Bluetooth state obtained.|
**Example** **Example**
...@@ -130,8 +128,8 @@ Obtains the profile connection state of this Bluetooth device. ...@@ -130,8 +128,8 @@ Obtains the profile connection state of this Bluetooth device.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ---------------------------------------- | ------------------- |
| [ProfileConnectionState](#profileconnectionstate) | Profile connection state obtained.| | [ProfileConnectionState](#profileconnectionstate) | Profile connection state obtained.|
**Example** **Example**
...@@ -153,14 +151,14 @@ Sets the name of the local Bluetooth device. ...@@ -153,14 +151,14 @@ Sets the name of the local Bluetooth device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ---- | ------ | ---- | --------------------- |
| name | string | Yes| Bluetooth device name to set. It cannot exceed 248 characters.| | name | string | Yes | Bluetooth name to set. It cannot exceed 248 bytes.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ------------------------------ |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -182,14 +180,14 @@ Initiates Bluetooth pairing. ...@@ -182,14 +180,14 @@ Initiates Bluetooth pairing.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ----------------------------------- |
| deviceId | string | Yes| Address of the remote device to pair, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the remote device to pair, for example, XX:XX:XX:XX:XX:XX.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -212,14 +210,14 @@ Obtains the connection status of a profile. ...@@ -212,14 +210,14 @@ Obtains the connection status of a profile.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | --------- | --------- | ---- | ------------------------------------- |
| ProfileId | profileId | Yes| ID of the target profile, for example, **PROFILE_A2DP_SOURCE**.| | ProfileId | profileId | Yes | ID of the target profile, for example, **PROFILE_A2DP_SOURCE**.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ---------------------------------------- | ------------- |
| [ProfileConnectionState](#ProfileConnectionState) | Profile connection state obtained.| | [ProfileConnectionState](#ProfileConnectionState) | Profile connection state obtained.|
**Example** **Example**
...@@ -241,14 +239,14 @@ Cancels a paired remote device. ...@@ -241,14 +239,14 @@ Cancels a paired remote device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ------------------------------------- |
| deviceId | string | Yes| Address of the remote device to cancel, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the remote device to cancel, for example, XX:XX:XX:XX:XX:XX.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -270,14 +268,14 @@ Obtains the name of the remote Bluetooth device. ...@@ -270,14 +268,14 @@ Obtains the name of the remote Bluetooth device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------ | ---- | --------------------------------- |
| deviceId | string | Yes| Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------ | ------------- |
| string | Device name (a string) obtained.| | string | Device name (a string) obtained.|
**Example** **Example**
...@@ -299,14 +297,14 @@ Obtains the type of the remote Bluetooth device. ...@@ -299,14 +297,14 @@ Obtains the type of the remote Bluetooth device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------ | ---- | --------------------------------- |
| deviceId | string | Yes| Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | --------------------------- | -------- |
| [DeviceClass](#deviceclass) | Type of a remote device obtained.| | [DeviceClass](#deviceclass) | Type of a remote device obtained.|
**Example** **Example**
...@@ -328,8 +326,8 @@ Obtains the Bluetooth pairing list. ...@@ -328,8 +326,8 @@ Obtains the Bluetooth pairing list.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------------------- | ------------- |
| Array&lt;string&gt; | List of the addresses of the paired Bluetooth devices.| | Array&lt;string&gt; | List of the addresses of the paired Bluetooth devices.|
**Example** **Example**
...@@ -351,15 +349,15 @@ Sets the Bluetooth scan mode so that the device can be discovered by a remote de ...@@ -351,15 +349,15 @@ Sets the Bluetooth scan mode so that the device can be discovered by a remote de
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------- | ---- | ---------------------------- |
| mode | [ScanMode](#scanmode) | Yes| Bluetooth scan mode to set.| | mode | [ScanMode](#scanmode) | Yes | Bluetooth scan mode to set. |
| duration | number | Yes| Duration (in seconds) in which the device can be discovered. The value **0** indicates unlimited time.| | duration | number | Yes | Duration (in seconds) in which the device can be discovered. The value **0** indicates unlimited time.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -382,8 +380,8 @@ Obtains the Bluetooth scan mode. ...@@ -382,8 +380,8 @@ Obtains the Bluetooth scan mode.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | --------------------- | ------- |
| [ScanMode](#scanmode) | Bluetooth scan mode obtained.| | [ScanMode](#scanmode) | Bluetooth scan mode obtained.|
**Example** **Example**
...@@ -405,8 +403,8 @@ Starts Bluetooth scan to discover remote devices. ...@@ -405,8 +403,8 @@ Starts Bluetooth scan to discover remote devices.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -433,8 +431,8 @@ Stops Bluetooth scan. ...@@ -433,8 +431,8 @@ Stops Bluetooth scan.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -456,15 +454,15 @@ Sets the device pairing confirmation. ...@@ -456,15 +454,15 @@ Sets the device pairing confirmation.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------- | ---- | -------------------------------- |
| device | string | Yes| Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.| | device | string | Yes | Address of the target remote device, for example, XX:XX:XX:XX:XX:XX.|
| accept | boolean | Yes| Whether to accept the pairing request. The value **true** means to accept the pairing request, and the value **false** means the opposite.| | accept | boolean | Yes | Whether to accept the pairing request. The value **true** means to accept the pairing request, and the value **false** means the opposite. |
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ---------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -491,10 +489,10 @@ Subscribes to the Bluetooth device discovery events. ...@@ -491,10 +489,10 @@ Subscribes to the Bluetooth device discovery events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ----------------------------------- | ---- | -------------------------------------- |
| type | string | Yes| Event type. The value **bluetoothDeviceFind** indicates an event reported when a Bluetooth device is discovered.| | type | string | Yes | Event type. The value **bluetoothDeviceFind** indicates an event reported when a Bluetooth device is discovered.|
| callback | Callback&lt;Array&lt;string&gt;&gt; | Yes| Callback invoked to return the discovered devices. You need to implement this callback.| | callback | Callback&lt;Array&lt;string&gt;&gt; | Yes | Callback invoked to return the discovered devices. You need to implement this callback. |
**Return value** **Return value**
...@@ -522,10 +520,10 @@ Unsubscribes from the Bluetooth device discovery events. ...@@ -522,10 +520,10 @@ Unsubscribes from the Bluetooth device discovery events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ----------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **bluetoothDeviceFind** indicates an event reported when a Bluetooth device is discovered.| | type | string | Yes | Event type. The value **bluetoothDeviceFind** indicates an event reported when a Bluetooth device is discovered. |
| callback | Callback&lt;Array&lt;string&gt;&gt; | No| Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;Array&lt;string&gt;&gt; | No | Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -554,10 +552,10 @@ Subscribes to the pairing request events of the remote Bluetooth device. ...@@ -554,10 +552,10 @@ Subscribes to the pairing request events of the remote Bluetooth device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | -------------------------------- |
| type | string | Yes| Event type. The value **pinRequired** indicates a pairing request event.| | type | string | Yes | Event type. The value **pinRequired** indicates a pairing request event. |
| callback | Callback&lt;[PinRequiredParam](#pinrequiredparam)&gt; | Yes| Callback invoked to return the pairing request. You need to implement this callback.| | callback | Callback&lt;[PinRequiredParam](#pinrequiredparam)&gt; | Yes | Callback invoked to return the pairing request. You need to implement this callback.|
**Return value** **Return value**
...@@ -585,10 +583,10 @@ Unsubscribes from the pairing request events of the remote Bluetooth device. ...@@ -585,10 +583,10 @@ Unsubscribes from the pairing request events of the remote Bluetooth device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **pinRequired** indicates a pairing request event.| | type | string | Yes | Event type. The value **pinRequired** indicates a pairing request event. |
| callback | Callback&lt;[PinRequiredParam](#pinrequiredparam)&gt; | No| Callback used to report the Bluetooth pairing request. The input parameter is the pairing request parameter. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[PinRequiredParam](#pinrequiredparam)&gt; | No | Callback used to report the Bluetooth pairing request. The input parameter is the pairing request parameter. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -617,10 +615,10 @@ Subscribes to the Bluetooth pairing state change events. ...@@ -617,10 +615,10 @@ Subscribes to the Bluetooth pairing state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------------------------------ |
| type | string | Yes| Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event.| | type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event.|
| callback | Callback&lt;[BondStateParam](#bondstate)&gt; | Yes| Callback invoked to return the pairing state. You need to implement this callback.| | callback | Callback&lt;[BondStateParam](#bondstate)&gt; | Yes | Callback invoked to return the pairing state. You need to implement this callback. |
**Return value** **Return value**
...@@ -648,10 +646,10 @@ Unsubscribes from the Bluetooth pairing state change events. ...@@ -648,10 +646,10 @@ Unsubscribes from the Bluetooth pairing state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event.| | type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event. |
| callback | Callback&lt;[BondStateParam](#bondstate)&gt; | No| Callback used to report the change of the Bluetooth pairing state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[BondStateParam](#bondstate)&gt; | No | Callback used to report the change of the Bluetooth pairing state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -680,10 +678,10 @@ Subscribes to the Bluetooth connection state change events. ...@@ -680,10 +678,10 @@ Subscribes to the Bluetooth connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | -------------------------------- |
| type | string | Yes| Event type. The value **stateChange** indicates a Bluetooth connection state change event.| | type | string | Yes | Event type. The value **stateChange** indicates a Bluetooth connection state change event. |
| callback | Callback&lt;[BluetoothState](#bluetoothstate)&gt; | Yes| Callback invoked to return the Bluetooth connection state. You need to implement this callback.| | callback | Callback&lt;[BluetoothState](#bluetoothstate)&gt; | Yes | Callback invoked to return the Bluetooth connection state. You need to implement this callback.|
**Return value** **Return value**
...@@ -711,10 +709,10 @@ Unsubscribes from the Bluetooth connection state change events. ...@@ -711,10 +709,10 @@ Unsubscribes from the Bluetooth connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **stateChange** indicates a Bluetooth connection state change event.| | type | string | Yes | Event type. The value **stateChange** indicates a Bluetooth connection state change event. |
| callback | Callback&lt;[BluetoothState](#bluetoothstate)&gt; | No| Callback used to report the Bluetooth connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[BluetoothState](#bluetoothstate)&gt; | No | Callback used to report the Bluetooth connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -743,11 +741,11 @@ Creates a server listening socket. ...@@ -743,11 +741,11 @@ Creates a server listening socket.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------------- | ---- | ----------------------- |
| name | string | Yes| Name of the service.| | name | string | Yes | Name of the service. |
| option | [SppOption](#sppoption) | Yes| Serial port profile (SPP) listening configuration.| | option | [SppOption](#sppoption) | Yes | Serial port profile (SPP) listening configuration. |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the server socket ID.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the server socket ID.|
**Example** **Example**
...@@ -776,10 +774,10 @@ Listens for a connection to be made to this socket from the client and accepts i ...@@ -776,10 +774,10 @@ Listens for a connection to be made to this socket from the client and accepts i
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------------ | --------------------------- | ---- | ----------------------- |
| serverSocket | number | Yes| Server socket ID.| | serverSocket | number | Yes | Server socket ID. |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the client socket ID.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the client socket ID.|
**Example** **Example**
...@@ -809,11 +807,11 @@ Initiates an SPP connection to a remote device from the client. ...@@ -809,11 +807,11 @@ Initiates an SPP connection to a remote device from the client.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------------- | ---- | ------------------------------ |
| device | string | Yes| Address of the remote device, for example, XX:XX:XX:XX:XX:XX.| | device | string | Yes | Address of the remote device, for example, XX:XX:XX:XX:XX:XX.|
| option | [SppOption](#sppoption) | Yes| Configuration for connecting to the SPP client.| | option | [SppOption](#sppoption) | Yes | Configuration for connecting to the SPP client. |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the client socket ID.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the client socket ID. |
**Example** **Example**
...@@ -842,9 +840,9 @@ Closes the listening socket of the server. ...@@ -842,9 +840,9 @@ Closes the listening socket of the server.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | --------------- |
| socket | number | Yes| ID of the listening socket on the server. The ID is obtained by **sppListen**.| | socket | number | Yes | ID of the listening socket on the server. The ID is obtained by **sppListen**.|
**Example** **Example**
...@@ -863,10 +861,10 @@ Closes the client socket. ...@@ -863,10 +861,10 @@ Closes the client socket.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------------- |
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| socket | number | Yes| Client socket ID, which is obtained by **sppAccept** or **sppConnect**.| | socket | number | Yes | Client socket ID, which is obtained by **sppAccept** or **sppConnect**.|
**Example** **Example**
...@@ -885,17 +883,16 @@ Writes data to the remote device through the socket. ...@@ -885,17 +883,16 @@ Writes data to the remote device through the socket.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------------ | ----------- | ---- | ------------- |
| clientSocket | number | Yes| Client socket ID, which is obtained by **sppAccept** or **sppConnect**.| | clientSocket | number | Yes | Client socket ID, which is obtained by **sppAccept** or **sppConnect**.|
| data | ArrayBuffer | Yes| Data to write.| | data | ArrayBuffer | Yes | Data to write. |
**Return value** **Return value**
| | | | Type | Description |
| -------- | -------- | | ------- | ------------------------- |
| Type | Description | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
**Example** **Example**
...@@ -922,11 +919,11 @@ Subscribes to the SPP read request events. ...@@ -922,11 +919,11 @@ Subscribes to the SPP read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------------ | --------------------------- | ---- | -------------------------- |
| type | string | Yes| Event type. The value **sppRead** indicates an SPP read request event.| | type | string | Yes | Event type. The value **sppRead** indicates an SPP read request event.|
| clientSocket | number | Yes| Client socket ID, which is obtained by **sppAccept** or **sppConnect**.| | clientSocket | number | Yes | Client socket ID, which is obtained by **sppAccept** or **sppConnect**. |
| callback | Callback&lt;ArrayBuffer&gt; | Yes| Callback invoked to return the data read.| | callback | Callback&lt;ArrayBuffer&gt; | Yes | Callback invoked to return the data read. |
**Return value** **Return value**
...@@ -953,11 +950,11 @@ Unsubscribes from the SPP read request events. ...@@ -953,11 +950,11 @@ Unsubscribes from the SPP read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------------ | --------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **sppRead** indicates an SPP read request event.| | type | string | Yes | Event type. The value **sppRead** indicates an SPP read request event. |
| clientSocket | number | Yes| Client socket ID, which is obtained by **sppAccept** or **sppConnect**.| | clientSocket | number | Yes | Client socket ID, which is obtained by **sppAccept** or **sppConnect**. |
| callback | Callback&lt;ArrayBuffer&gt; | No| Callback used to report an SPP read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;ArrayBuffer&gt; | No | Callback used to report an SPP read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -980,21 +977,20 @@ Obtains a profile object. ...@@ -980,21 +977,20 @@ Obtains a profile object.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | --------- | --------- | ---- | ------------------------------------- |
| ProfileId | profileId | Yes| ID of the target profile, for example, **PROFILE_A2DP_SOURCE**.| | ProfileId | profileId | Yes | ID of the target profile, for example, **PROFILE_A2DP_SOURCE**.|
**Return value** **Return value**
| | | | Type | Description |
| -------- | -------- | | ---------------------------------------- | ---------------------------------------- |
| Type | Description | | A2dpSourceProfile or HandsFreeAudioGatewayProfile| Profile object obtained. Only **A2dpSourceProfile** and **HandsFreeAudioGatewayProfile** are supported.|
| A2dpSourceProfile or HandsFreeAudioGatewayProfile | Profile object obtained. Only **A2dpSourceProfile** and **HandsFreeAudioGatewayProfile** are supported. |
**Example** **Example**
```js ```js
A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE);
``` ```
...@@ -1010,8 +1006,8 @@ Creates a **GattServer** instance. ...@@ -1010,8 +1006,8 @@ Creates a **GattServer** instance.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------------------------- | ------------------------------------ |
| [GattServer](#gattserver) | **GattServer** instance created. Before using a method of the server, you must create a **GattSever** instance.| | [GattServer](#gattserver) | **GattServer** instance created. Before using a method of the server, you must create a **GattSever** instance.|
**Example** **Example**
...@@ -1031,14 +1027,14 @@ Creates a **GattClientDevice** instance. ...@@ -1031,14 +1027,14 @@ Creates a **GattClientDevice** instance.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ------------------------------------ |
| deviceId | string | Yes| Address of the remote device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the remote device, for example, XX:XX:XX:XX:XX:XX.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------------------------------------- | ------------------------------------ |
| [GattClientDevice](#gattclientdevice) | **GattClientDevice** instance created. Before using a method of the client, you must create a **GattClientDevice** instance.| | [GattClientDevice](#gattclientdevice) | **GattClientDevice** instance created. Before using a method of the client, you must create a **GattClientDevice** instance.|
**Example** **Example**
...@@ -1060,8 +1056,8 @@ Obtains the BLE devices connected to this device. ...@@ -1060,8 +1056,8 @@ Obtains the BLE devices connected to this device.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------------------- | ------------------- |
| Array&lt;string&gt; | Addresses of the BLE devices connected to this device.| | Array&lt;string&gt; | Addresses of the BLE devices connected to this device.|
**Example** **Example**
...@@ -1083,10 +1079,10 @@ Starts a BLE scan. ...@@ -1083,10 +1079,10 @@ Starts a BLE scan.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------- | -------------------------------------- | ---- | ----------------------------------- |
| filters | Array&lt;[ScanFilter](#scanfilter)&gt; | Yes| Criteria for filtering the scan result. Set this parameter to **null** if you do not want to filter the scan result.| | filters | Array&lt;[ScanFilter](#scanfilter)&gt; | Yes | Criteria for filtering the scan result. Set this parameter to **null** if you do not want to filter the scan result.|
| options | [ScanOptions](#scanoptions) | No| Scan options.| | options | [ScanOptions](#scanoptions) | No | Scan options. |
**Return value** **Return value**
...@@ -1147,10 +1143,10 @@ Subscribe to the BLE device discovery events. ...@@ -1147,10 +1143,10 @@ Subscribe to the BLE device discovery events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ----------------------------------- |
| type | string | Yes| Event type. The value **BLEDeviceFind** indicates an event reported when a BLE device is discovered.| | type | string | Yes | Event type. The value **BLEDeviceFind** indicates an event reported when a BLE device is discovered. |
| callback | Callback&lt;Array&lt;[ScanResult](#scanresult)&gt;&gt; | Yes| Callback invoked to return the discovered devices. You need to implement this callback.| | callback | Callback&lt;Array&lt;[ScanResult](#scanresult)&gt;&gt; | Yes | Callback invoked to return the discovered devices. You need to implement this callback.|
**Return value** **Return value**
...@@ -1178,10 +1174,10 @@ Unsubscribes from the BLE device discovery events. ...@@ -1178,10 +1174,10 @@ Unsubscribes from the BLE device discovery events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **BLEDeviceFind** indicates an event reported when a BLE device is discovered.| | type | string | Yes | Event type. The value **BLEDeviceFind** indicates an event reported when a BLE device is discovered. |
| callback | Callback&lt;Array&lt;[ScanResult](#scanresult)&gt;&gt; | No| Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;Array&lt;[ScanResult](#scanresult)&gt;&gt; | No | Callback used to report the discovered devices. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -1219,9 +1215,9 @@ No value is returned. ...@@ -1219,9 +1215,9 @@ No value is returned.
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------------------- | ------------- |
| Type | Description | | Type | Description |
| Array&lt;string&gt; | List of addresses of the connected devices. | | Array&lt;string&gt; | List of addresses of the connected devices. |
...@@ -1237,15 +1233,15 @@ Obtains the connection status of the profile. ...@@ -1237,15 +1233,15 @@ Obtains the connection status of the profile.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
| |
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ---------------------------------------- | --------------- |
| Type | Description | | Type | Description |
| [ProfileConnectionState](#profileconnectionState) | Profile connection state obtained. | | [ProfileConnectionState](#profileconnectionState) | Profile connection state obtained. |
...@@ -1267,23 +1263,23 @@ Sets up an Advanced Audio Distribution Profile (A2DP) connection. ...@@ -1267,23 +1263,23 @@ Sets up an Advanced Audio Distribution Profile (A2DP) connection.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
| |
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | ------------------- |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
**Example** **Example**
```js ```js
A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE)
boolean ret = a2dpSrc.connect('XX:XX:XX:XX:XX:XX'); let ret = a2dpSrc.connect('XX:XX:XX:XX:XX:XX');
``` ```
...@@ -1299,23 +1295,23 @@ Disconnects an A2DP connection. ...@@ -1299,23 +1295,23 @@ Disconnects an A2DP connection.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
| |
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | ------------------- |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
**Example** **Example**
```js ```js
A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE);
boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX'); let boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX');
``` ```
...@@ -1329,10 +1325,10 @@ Subscribes to the A2DP connection status change events. ...@@ -1329,10 +1325,10 @@ Subscribes to the A2DP connection status change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectionStateChange** indicates an A2DP connection state change event.| | type | string | Yes | Event type. The value **connectionStateChange** indicates an A2DP connection state change event.|
| callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes| Callback invoked to return the A2DP connection state change event.| | callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes | Callback invoked to return the A2DP connection state change event. |
**Return value** **Return value**
...@@ -1358,10 +1354,10 @@ Unsubscribes from the A2DP connection status change events. ...@@ -1358,10 +1354,10 @@ Unsubscribes from the A2DP connection status change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectionStateChange** indicates an A2DP connection state change event.| | type | string | Yes | Event type. The value **connectionStateChange** indicates an A2DP connection state change event.|
| callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes| Callback invoked to return the A2DP connection state change event.| | callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes | Callback invoked to return the A2DP connection state change event. |
**Return value** **Return value**
...@@ -1387,22 +1383,22 @@ Obtains the playing status of a device. ...@@ -1387,22 +1383,22 @@ Obtains the playing status of a device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ----------------------------- | ---------- |
| Type | Description | | Type | Description |
| [PlayingState](#PlayingState) | Playing status obtained. | | [PlayingState](#PlayingState) | Playing status obtained. |
**Example** **Example**
```js ```js
A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE);
PlayingState state = a2dpSrc.getPlayingState('XX:XX:XX:XX:XX:XX'); let state = a2dpSrc.getPlayingState('XX:XX:XX:XX:XX:XX');
``` ```
...@@ -1423,23 +1419,23 @@ Sets up a Hands-free Profile (HFP) connection of a device. ...@@ -1423,23 +1419,23 @@ Sets up a Hands-free Profile (HFP) connection of a device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
| |
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | ------------------- |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
**Example** **Example**
```js ```js
HandsFreeAudioGatewayProfile hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); let hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY);
boolean ret = hfpAg.connect('XX:XX:XX:XX:XX:XX'); let ret = hfpAg.connect('XX:XX:XX:XX:XX:XX');
``` ```
...@@ -1447,7 +1443,7 @@ boolean ret = hfpAg.connect('XX:XX:XX:XX:XX:XX'); ...@@ -1447,7 +1443,7 @@ boolean ret = hfpAg.connect('XX:XX:XX:XX:XX:XX');
disconnect(device: string): boolean disconnect(device: string): boolean
Sets up a Hands-free Profile (HFP) connection of a device. Disconnects the HFP connection of a device.
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH **Required permissions**: ohos.permission.DISCOVER_BLUETOOTH
...@@ -1455,23 +1451,22 @@ Sets up a Hands-free Profile (HFP) connection of a device. ...@@ -1455,23 +1451,22 @@ Sets up a Hands-free Profile (HFP) connection of a device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------ | ------ | ---- | ------- |
| device | string | Yes| Address of the remote device.| | device | string | Yes | Address of the remote device.|
| |
**Return value** **Return value**
| | | | Type | Description |
| -------- | -------- | | ------- | ------------------- |
| Type | Description | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
**Example** **Example**
```js ```js
HandsFreeAudioGatewayProfile hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); let hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY);
boolean ret = hfpAg.disconnect('XX:XX:XX:XX:XX:XX'); let ret = hfpAg.disconnect('XX:XX:XX:XX:XX:XX');
``` ```
...@@ -1485,10 +1480,10 @@ Subscribes to the HFP connection status change events. ...@@ -1485,10 +1480,10 @@ Subscribes to the HFP connection status change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectionStateChange** indicates an A2DP connection state change event.| | type | string | Yes | Event type. The value **connectionStateChange** indicates an A2DP connection state change event.|
| callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes| Callback invoked to return the A2DP connection state change event.| | callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes | Callback invoked to return the A2DP connection state change event. |
**Return value** **Return value**
...@@ -1514,10 +1509,10 @@ Unsubscribes from the HFP connection status change events. ...@@ -1514,10 +1509,10 @@ Unsubscribes from the HFP connection status change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectionStateChange** indicates an A2DP connection state change event.| | type | string | Yes | Event type. The value **connectionStateChange** indicates an A2DP connection state change event.|
| callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes| Callback invoked to return the A2DP connection state change event.| | callback | Callback&lt;[StateChangeParam](#StateChangeParam)&gt; | Yes | Callback invoked to return the A2DP connection state change event. |
**Return value** **Return value**
...@@ -1550,11 +1545,11 @@ Starts BLE advertising. ...@@ -1550,11 +1545,11 @@ Starts BLE advertising.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ----------- | ------------------------------------- | ---- | -------------- |
| setting | [AdvertiseSetting](#advertisesetting) | Yes| Settings related to BLE advertising.| | setting | [AdvertiseSetting](#advertisesetting) | Yes | Settings related to BLE advertising. |
| advData | [AdvertiseData](#advertisedata) | Yes| Content of the BLE advertisement packet.| | advData | [AdvertiseData](#advertisedata) | Yes | Content of the BLE advertisement packet. |
| advResponse | [AdvertiseData](#advertisedata) | No| Response to the BLE scan request.| | advResponse | [AdvertiseData](#advertisedata) | No | Response to the BLE scan request.|
**Return value** **Return value**
...@@ -1639,14 +1634,14 @@ Adds a service to this GATT server. ...@@ -1639,14 +1634,14 @@ Adds a service to this GATT server.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ------- | --------------------------- | ---- | ------------------------ |
| service | [GattService](#gattservice) | Yes| Service to add. Settings related to BLE advertising.| | service | [GattService](#gattservice) | Yes | Service to add. Settings related to BLE advertising.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -1698,14 +1693,14 @@ Removes a service from this GATT server. ...@@ -1698,14 +1693,14 @@ Removes a service from this GATT server.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ----------- | ------ | ---- | ---------------------------------------- |
| serviceUuid | string | Yes| Universally unique identifier (UUID) of the service to remove, for example, **00001810-0000-1000-8000-00805F9B34FB**.| | serviceUuid | string | Yes | Universally unique identifier (UUID) of the service to remove, for example, **00001810-0000-1000-8000-00805F9B34FB**.|
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | -------------------------- |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
...@@ -1747,15 +1742,15 @@ Notifies the connected client device when a characteristic value changes. ...@@ -1747,15 +1742,15 @@ Notifies the connected client device when a characteristic value changes.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------------- | ---------------------------------------- | ---- | --------------------------------------- |
| deviceId | string | Yes| Address of the client that receives notifications, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Address of the client that receives notifications, for example, XX:XX:XX:XX:XX:XX.|
| notifyCharacteristic | [NotifyCharacteristic](#notifycharacteristic) | Yes| New characteristic value.| | notifyCharacteristic | [NotifyCharacteristic](#notifycharacteristic) | Yes | New characteristic value. |
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | ------------------------ |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
...@@ -1781,14 +1776,14 @@ Sends a response to a read or write request from the GATT client. ...@@ -1781,14 +1776,14 @@ Sends a response to a read or write request from the GATT client.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------- | --------------------------------- | ---- | --------------- |
| serverResponse | [ServerResponse](#serverresponse) | Yes| Response returned by the GATT server.| | serverResponse | [ServerResponse](#serverresponse) | Yes | Response returned by the GATT server.|
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ------- | -------------------------- |
| Type | Description | | Type | Description |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise. | | boolean | Returns **true** if the operation is successful; returns **false** otherwise. |
...@@ -1829,10 +1824,10 @@ Subscribes to the characteristic read request events. ...@@ -1829,10 +1824,10 @@ Subscribes to the characteristic read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------------------------------- |
| type | string | Yes| Event type. The value **characteristicRead** indicates a characteristic read request event.| | type | string | Yes | Event type. The value **characteristicRead** indicates a characteristic read request event.|
| callback | Callback&lt;[CharacteristicReadReq](#characteristicreadreq)&gt; | Yes| Callback invoked to return a characteristic read request from the GATT client.| | callback | Callback&lt;[CharacteristicReadReq](#characteristicreadreq)&gt; | Yes | Callback invoked to return a characteristic read request from the GATT client. |
**Return value** **Return value**
...@@ -1877,10 +1872,10 @@ Unsubscribes from the characteristic read request events. ...@@ -1877,10 +1872,10 @@ Unsubscribes from the characteristic read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **characteristicRead** indicates a characteristic read request event.| | type | string | Yes | Event type. The value **characteristicRead** indicates a characteristic read request event. |
| callback | Callback&lt;[CharacteristicReadReq](#characteristicreadreq)&gt; | No| Callback used to report a characteristic read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[CharacteristicReadReq](#characteristicreadreq)&gt; | No | Callback used to report a characteristic read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -1906,10 +1901,10 @@ Subscribes to the characteristic write request events. ...@@ -1906,10 +1901,10 @@ Subscribes to the characteristic write request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | -------------------------------------- |
| type | string | Yes| Event type. The value **characteristicWrite** indicates a characteristic write request event.| | type | string | Yes | Event type. The value **characteristicWrite** indicates a characteristic write request event.|
| callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | Yes| Callback invoked to return a characteristic write request from the GATT client.| | callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | Yes | Callback invoked to return a characteristic write request from the GATT client. |
**Return value** **Return value**
...@@ -1957,10 +1952,10 @@ Unsubscribes from the characteristic write request events. ...@@ -1957,10 +1952,10 @@ Unsubscribes from the characteristic write request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **characteristicWrite** indicates a characteristic write request event.| | type | string | Yes | Event type. The value **characteristicWrite** indicates a characteristic write request event. |
| callback | Callback&lt;[CharacteristicWriteReq](#characteristicwritereq)&gt; | No| Callback used to report a characteristic write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[CharacteristicWriteReq](#characteristicwritereq)&gt; | No | Callback used to report a characteristic write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -1986,10 +1981,10 @@ Subscribes to the descriptor read request events. ...@@ -1986,10 +1981,10 @@ Subscribes to the descriptor read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | --------------------------------- |
| type | string | Yes| Event type. The value **descriptorRead** indicates a descriptor read request event.| | type | string | Yes | Event type. The value **descriptorRead** indicates a descriptor read request event.|
| callback | Callback&lt;[DescriptorReadReq](#descriptorreadreq)&gt; | Yes| Callback invoked to return a characteristic read request from the GATT client.| | callback | Callback&lt;[DescriptorReadReq](#descriptorreadreq)&gt; | Yes | Callback invoked to return a characteristic read request from the GATT client. |
**Return value** **Return value**
...@@ -2034,10 +2029,10 @@ Unsubscribes from the descriptor read request events. ...@@ -2034,10 +2029,10 @@ Unsubscribes from the descriptor read request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **descriptorRead** indicates a descriptor read request event.| | type | string | Yes | Event type. The value **descriptorRead** indicates a descriptor read request event. |
| callback | Callback&lt;[DescriptorReadReq](#descriptorreadreq)&gt; | No| Callback used to report a descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[DescriptorReadReq](#descriptorreadreq)&gt; | No | Callback used to report a descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -2063,10 +2058,10 @@ Subscribes to the descriptor write request events. ...@@ -2063,10 +2058,10 @@ Subscribes to the descriptor write request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------- |
| type | string | Yes| Event type. The value **descriptorWrite** indicates a descriptor write request event.| | type | string | Yes | Event type. The value **descriptorWrite** indicates a descriptor write request event.|
| callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | Yes| Callback invoked to return a characteristic write request from the GATT client.| | callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | Yes | Callback invoked to return a characteristic write request from the GATT client. |
**Return value** **Return value**
...@@ -2114,10 +2109,10 @@ Unsubscribes from the descriptor write request events. ...@@ -2114,10 +2109,10 @@ Unsubscribes from the descriptor write request events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **descriptorWrite** indicates a descriptor write request event.| | type | string | Yes | Event type. The value **descriptorWrite** indicates a descriptor write request event. |
| callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | No| Callback used to report a descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[DescriptorWriteReq](#descriptorwritereq)&gt; | No | Callback used to report a descriptor write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -2143,10 +2138,10 @@ Subscribes to the BLE connection state change events. ...@@ -2143,10 +2138,10 @@ Subscribes to the BLE connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectStateChange** indicates a BLE connection state change event.| | type | string | Yes | Event type. The value **connectStateChange** indicates a BLE connection state change event.|
| callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | Yes| Callback invoked to return the BLE connection state.| | callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | Yes | Callback invoked to return the BLE connection state. |
**Return value** **Return value**
...@@ -2177,10 +2172,10 @@ Unsubscribes from the BLE connection state change events. ...@@ -2177,10 +2172,10 @@ Unsubscribes from the BLE connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **connectStateChange** indicates a BLE connection state change event.| | type | string | Yes | Event type. The value **connectStateChange** indicates a BLE connection state change event.|
| callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | No| Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | No | Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -2211,8 +2206,8 @@ Initiates a connection to the remote BLE device. ...@@ -2211,8 +2206,8 @@ Initiates a connection to the remote BLE device.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ------------------------- |
| boolean | Returns **true** if the connection is successful; returns **false** otherwise.| | boolean | Returns **true** if the connection is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2235,8 +2230,8 @@ Disconnects from the remote BLE device. ...@@ -2235,8 +2230,8 @@ Disconnects from the remote BLE device.
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ---------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2259,8 +2254,8 @@ Closes this GATT client to unregister it from the protocol stack. After this met ...@@ -2259,8 +2254,8 @@ Closes this GATT client to unregister it from the protocol stack. After this met
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | -------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2285,9 +2280,9 @@ Obtains all services of the remote BLE device. This method uses an asynchronous ...@@ -2285,9 +2280,9 @@ Obtains all services of the remote BLE device. This method uses an asynchronous
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ------------------------ |
| callback | AsyncCallback&lt;Array&lt;[GattService](#gattservice)&gt;&gt; | Yes| Callback invoked to return the services obtained.| | callback | AsyncCallback&lt;Array&lt;[GattService](#gattservice)&gt;&gt; | Yes | Callback invoked to return the services obtained.|
**Return value** **Return value**
...@@ -2329,8 +2324,8 @@ Obtains all services of the remote BLE device. This method uses a promise to ret ...@@ -2329,8 +2324,8 @@ Obtains all services of the remote BLE device. This method uses a promise to ret
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ---------------------------------------- | --------------------------- |
| Promise&lt;Array&lt;[GattService](#gattservice)&gt;&gt; | Promise used to return the services obtained.| | Promise&lt;Array&lt;[GattService](#gattservice)&gt;&gt; | Promise used to return the services obtained.|
**Example** **Example**
...@@ -2360,10 +2355,10 @@ Reads the characteristic value of the specific service of the remote BLE device. ...@@ -2360,10 +2355,10 @@ Reads the characteristic value of the specific service of the remote BLE device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------- | ---------------------------------------- | ---- | ----------------------- |
| characteristic | [BLECharacteristic](#blecharacteristic) | Yes| Characteristic value to read.| | characteristic | [BLECharacteristic](#blecharacteristic) | Yes | Characteristic value to read. |
| callback | AsyncCallback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes| Callback invoked to return the characteristic value read.| | callback | AsyncCallback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes | Callback invoked to return the characteristic value read.|
**Return value** **Return value**
...@@ -2414,14 +2409,14 @@ Reads the characteristic value of the specific service of the remote BLE device. ...@@ -2414,14 +2409,14 @@ Reads the characteristic value of the specific service of the remote BLE device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------- | --------------------------------------- | ---- | -------- |
| characteristic | [BLECharacteristic](#blecharacteristic) | Yes| Characteristic value to read.| | characteristic | [BLECharacteristic](#blecharacteristic) | Yes | Characteristic value to read.|
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ---------------------------------------- | -------------------------- |
| Type | Description | | Type | Description |
| Promise&lt;[BLECharacteristic](#blecharacteristic)&gt; | Promise used to return the characteristic value read. | | Promise&lt;[BLECharacteristic](#blecharacteristic)&gt; | Promise used to return the characteristic value read. |
...@@ -2461,10 +2456,10 @@ Reads the descriptor contained in the specific characteristic of the remote BLE ...@@ -2461,10 +2456,10 @@ Reads the descriptor contained in the specific characteristic of the remote BLE
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ---------- | ---------------------------------------- | ---- | ----------------------- |
| descriptor | [BLEDescriptor](#bledescriptor) | Yes| Descriptor to read.| | descriptor | [BLEDescriptor](#bledescriptor) | Yes | Descriptor to read. |
| callback | AsyncCallback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes| Callback invoked to return the descriptor read.| | callback | AsyncCallback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes | Callback invoked to return the descriptor read.|
**Return value** **Return value**
...@@ -2505,14 +2500,14 @@ Reads the descriptor contained in the specific characteristic of the remote BLE ...@@ -2505,14 +2500,14 @@ Reads the descriptor contained in the specific characteristic of the remote BLE
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ---------- | ------------------------------- | ---- | -------- |
| descriptor | [BLEDescriptor](#bledescriptor) | Yes| Descriptor to read.| | descriptor | [BLEDescriptor](#bledescriptor) | Yes | Descriptor to read.|
**Return value** **Return value**
| | | | | |
| -------- | -------- | | ---------------------------------------- | -------------------------- |
| Type | Description | | Type | Description |
| Promise&lt;[BLEDescriptor](#bledescriptor)&gt; | Promise used to return the descriptor read. | | Promise&lt;[BLEDescriptor](#bledescriptor)&gt; | Promise used to return the descriptor read. |
...@@ -2542,14 +2537,14 @@ Writes a characteristic value to the remote BLE device. ...@@ -2542,14 +2537,14 @@ Writes a characteristic value to the remote BLE device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------- | --------------------------------------- | ---- | ------------------- |
| characteristic | [BLECharacteristic](#blecharacteristic) | Yes| Binary value and other parameters of the BLE device characteristic.| | characteristic | [BLECharacteristic](#blecharacteristic) | Yes | Binary value and other parameters of the BLE device characteristic.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | --------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2592,14 +2587,14 @@ Writes binary data to the specific descriptor of the remote BLE device. ...@@ -2592,14 +2587,14 @@ Writes binary data to the specific descriptor of the remote BLE device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ---------- | ------------------------------- | ---- | ------------------ |
| descriptor | [BLEDescriptor](#bledescriptor) | Yes| Binary value and other parameters of the BLE device descriptor.| | descriptor | [BLEDescriptor](#bledescriptor) | Yes | Binary value and other parameters of the BLE device descriptor.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | --------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2633,14 +2628,14 @@ Sets the maximum transmission unit (MTU) that can be transmitted between the GAT ...@@ -2633,14 +2628,14 @@ Sets the maximum transmission unit (MTU) that can be transmitted between the GAT
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | ---- | ------ | ---- | -------------- |
| mtu | number | Yes| MTU to set, which ranges from 22 to 512 bytes.| | mtu | number | Yes | MTU to set, which ranges from 22 to 512 bytes.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ---------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2663,15 +2658,15 @@ Sets the function of notifying the GATT client when the characteristic value of ...@@ -2663,15 +2658,15 @@ Sets the function of notifying the GATT client when the characteristic value of
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------------- | --------------------------------------- | ---- | ----------------------------- |
| characteristic | [BLECharacteristic](#blecharacteristic) | Yes| BLE characteristic to listen for.| | characteristic | [BLECharacteristic](#blecharacteristic) | Yes | BLE characteristic to listen for. |
| enable | boolean | Yes| Whether to enable the notify function. The value **true** means to enable the notify function, and the value **false** means the opposite.| | enable | boolean | Yes | Whether to enable the notify function. The value **true** means to enable the notify function, and the value **false** means the opposite.|
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | ------- | ------------------------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example** **Example**
...@@ -2694,10 +2689,10 @@ Subscribes to the BLE characteristic change events. The client can receive a not ...@@ -2694,10 +2689,10 @@ Subscribes to the BLE characteristic change events. The client can receive a not
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **BLECharacteristicChange** indicates a characteristic value change event.| | type | string | Yes | Event type. The value **BLECharacteristicChange** indicates a characteristic value change event.|
| callback | Callback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes| Callback invoked to return the characteristic value changes.| | callback | Callback&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes | Callback invoked to return the characteristic value changes. |
**Return value** **Return value**
...@@ -2728,10 +2723,10 @@ Unsubscribes from the BLE characteristic change events. ...@@ -2728,10 +2723,10 @@ Unsubscribes from the BLE characteristic change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **BLECharacteristicChange** indicates a characteristic value change event.| | type | string | Yes | Event type. The value **BLECharacteristicChange** indicates a characteristic value change event.|
| callback | Callback&lt;[BLECharacteristic](#blecharacteristic)&gt; | No| Callback used to report the characteristic value. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[BLECharacteristic](#blecharacteristic)&gt; | No | Callback used to report the characteristic value. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -2757,10 +2752,10 @@ Subscribes to the BLE connection state change events. ...@@ -2757,10 +2752,10 @@ Subscribes to the BLE connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **BLEConnectionStateChange** indicates a BLE connection state change event.| | type | string | Yes | Event type. The value **BLEConnectionStateChange** indicates a BLE connection state change event.|
| callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | Yes| Callback invoked to return the BLE connection state.| | callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | Yes | Callback invoked to return the BLE connection state. |
**Return value** **Return value**
...@@ -2790,10 +2785,10 @@ Unsubscribes from the BLE connection state change events. ...@@ -2790,10 +2785,10 @@ Unsubscribes from the BLE connection state change events.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| type | string | Yes| Event type. The value **BLEConnectionStateChange** indicates a BLE connection state change event.| | type | string | Yes | Event type. The value **BLEConnectionStateChange** indicates a BLE connection state change event.|
| callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | No| Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.| | callback | Callback&lt;[BLEConnectChangedState](#bleconnectchangedstate)&gt; | No | Callback used to report the BLE connection state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
**Return value** **Return value**
...@@ -2819,9 +2814,9 @@ Obtains the name of the remote BLE device. This method uses an asynchronous call ...@@ -2819,9 +2814,9 @@ Obtains the name of the remote BLE device. This method uses an asynchronous call
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------------- | ---- | ------------------------------- |
| callback | AsyncCallback&lt;string&gt; | Yes| Callback invoked to return the remote BLE device name obtained.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the remote BLE device name obtained.|
**Return value** **Return value**
...@@ -2851,8 +2846,8 @@ Obtains the name of the remote BLE device. This method uses a promise to return ...@@ -2851,8 +2846,8 @@ Obtains the name of the remote BLE device. This method uses a promise to return
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | --------------------- | ---------------------------------- |
| Promise&lt;string&gt; | Promise used to return the remote BLE device name.| | Promise&lt;string&gt; | Promise used to return the remote BLE device name.|
**Example** **Example**
...@@ -2879,9 +2874,9 @@ Obtains the received signal strength indication (RSSI) of the remote BLE device. ...@@ -2879,9 +2874,9 @@ Obtains the received signal strength indication (RSSI) of the remote BLE device.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------------- | ---- | ------------------------------ |
| callback | AsyncCallback&lt;number&gt; | Yes| Callback invoked to return the RSSI, in dBm.| | callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the RSSI, in dBm.|
**Return value** **Return value**
...@@ -2912,8 +2907,8 @@ Obtains the RSSI of the remote BLE device. This method uses a promise to return ...@@ -2912,8 +2907,8 @@ Obtains the RSSI of the remote BLE device. This method uses a promise to return
**Return value** **Return value**
| Type| Description| | Type | Description |
| -------- | -------- | | --------------------- | --------------------------------- |
| Promise&lt;number&gt; | Promise used to return the RSSI, in dBm.| | Promise&lt;number&gt; | Promise used to return the RSSI, in dBm.|
**Example** **Example**
...@@ -2932,14 +2927,14 @@ Enumerates the scan modes. ...@@ -2932,14 +2927,14 @@ Enumerates the scan modes.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ---------------------------------------- | ---- | --------------- |
| SCAN_MODE_NONE | 0 | No scan mode.| | SCAN_MODE_NONE | 0 | No scan mode. |
| SCAN_MODE_CONNECTABLE | 1 | Connectable mode.| | SCAN_MODE_CONNECTABLE | 1 | Connectable mode. |
| SCAN_MODE_GENERAL_DISCOVERABLE | 2 | General discoverable mode.| | SCAN_MODE_GENERAL_DISCOVERABLE | 2 | General discoverable mode. |
| SCAN_MODE_LIMITED_DISCOVERABLE | 3 | Limited discoverable mode.| | SCAN_MODE_LIMITED_DISCOVERABLE | 3 | Limited discoverable mode. |
| SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE | 4 | General connectable and discoverable mode.| | SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE | 4 | General connectable and discoverable mode.|
| SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE | 5 | Limited connectable and discoverable mode.| | SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE | 5 | Limited connectable and discoverable mode.|
## BondState<sup>8+</sup><a name="BondState"></a> ## BondState<sup>8+</sup><a name="BondState"></a>
...@@ -2947,11 +2942,11 @@ Enumerates the pairing states. ...@@ -2947,11 +2942,11 @@ Enumerates the pairing states.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ------------------ | ---- | ------ |
| BOND_STATE_INVALID | 0 | Invalid pairing.| | BOND_STATE_INVALID | 0 | Invalid pairing.|
| BOND_STATE_BONDING | 1 | Pairing.| | BOND_STATE_BONDING | 1 | Pairing. |
| BOND_STATE_BONDED | 2 | Paired.| | BOND_STATE_BONDED | 2 | Paired. |
## SppOption<sup>8+</sup><a name="SppOption"></a> ## SppOption<sup>8+</sup><a name="SppOption"></a>
...@@ -2960,11 +2955,11 @@ Defines the SPP configuration parameters. ...@@ -2960,11 +2955,11 @@ Defines the SPP configuration parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------ | ------------------- | ---- | ---- | ----------- |
| uuid | string | Yes| Yes| UUID of the SPP.| | uuid | string | Yes | Yes | UUID of the SPP.|
| secure | boolean | Yes| Yes| Whether it is a secure channel.| | secure | boolean | Yes | Yes | Whether it is a secure channel. |
| type | [SppType](#spptype) | Yes| Yes| Type of the SPP link.| | type | [SppType](#spptype) | Yes | Yes | Type of the SPP link. |
## SppType<sup>8+</sup><a name="SppType"></a> ## SppType<sup>8+</sup><a name="SppType"></a>
...@@ -2973,9 +2968,9 @@ Enumerates the SPP link types. ...@@ -2973,9 +2968,9 @@ Enumerates the SPP link types.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ---------- | ---- | ------------- |
| SPP_RFCOMM | 0 | Radio frequency communication (RFCOMM) link type.| | SPP_RFCOMM | 0 | Radio frequency communication (RFCOMM) link type.|
## GattService ## GattService
...@@ -2984,12 +2979,12 @@ Defines the GATT service API parameters. ...@@ -2984,12 +2979,12 @@ Defines the GATT service API parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
| serviceUuid | string | Yes| Yes| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
| isPrimary | boolean | Yes| Yes| Whether the service is a primary service. The value **true** means a primary service.| | isPrimary | boolean | Yes | Yes | Whether the service is a primary service. The value **true** means a primary service. |
| characteristics | Array&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes| Yes| List of characteristics of the service.| | characteristics | Array&lt;[BLECharacteristic](#blecharacteristic)&gt; | Yes | Yes | List of characteristics of the service. |
| includeServices | Array&lt;[GattService](#gattservice)&gt; | Yes| Yes| Services on which the service depends.| | includeServices | Array&lt;[GattService](#gattservice)&gt; | Yes | Yes | Services on which the service depends. |
## BLECharacteristic ## BLECharacteristic
...@@ -2998,12 +2993,12 @@ Defines the characteristic API parameters. ...@@ -2998,12 +2993,12 @@ Defines the characteristic API parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- |
| serviceUuid | string | Yes| Yes| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| Yes| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | Yes | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| characteristicValue | ArrayBuffer | Yes| Yes| Binary value of the characteristic.| | characteristicValue | ArrayBuffer | Yes | Yes | Binary value of the characteristic. |
| descriptors | Array&lt;[BLEDescriptor](#bledescriptor)&gt; | Yes| Yes| List of descriptors of the characteristic.| | descriptors | Array&lt;[BLEDescriptor](#bledescriptor)&gt; | Yes | Yes | List of descriptors of the characteristic. |
## BLEDescriptor ## BLEDescriptor
...@@ -3012,12 +3007,12 @@ Defines the descriptor API parameters. ...@@ -3012,12 +3007,12 @@ Defines the descriptor API parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------ | ----------- | ---- | ---- | ---------------------------------------- |
| serviceUuid | string | Yes| Yes| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| Yes| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | Yes | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| descriptorUuid | string | Yes| Yes| UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.| | descriptorUuid | string | Yes | Yes | UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.|
| descriptorValue | ArrayBuffer | Yes| Yes| Binary value of the descriptor.| | descriptorValue | ArrayBuffer | Yes | Yes | Binary value of the descriptor. |
## NotifyCharacteristic ## NotifyCharacteristic
...@@ -3026,12 +3021,12 @@ Defines the parameters in the notifications sent when the server characteristic ...@@ -3026,12 +3021,12 @@ Defines the parameters in the notifications sent when the server characteristic
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------- | ----------- | ---- | ---- | ---------------------------------------- |
| serviceUuid | string | Yes| Yes| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| Yes| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | Yes | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| characteristicValue | ArrayBuffer | Yes| Yes| Binary value of the characteristic.| | characteristicValue | ArrayBuffer | Yes | Yes | Binary value of the characteristic. |
| confirm | boolean | Yes| Yes| Whether the notification needs to be confirmed by the remote end. For a notification, set it to **true**. In this case, the remote end must confirm the receipt of the notification. For an indication, set it to **false**. In this case, the remote end does not need to confirm the receipt of the notification.| | confirm | boolean | Yes | Yes | Whether the notification needs to be confirmed by the remote end. For a notification, set it to **true**. In this case, the remote end must confirm the receipt of the notification. For an indication, set it to **false**. In this case, the remote end does not need to confirm the receipt of the notification.|
## CharacteristicReadReq ## CharacteristicReadReq
...@@ -3040,13 +3035,13 @@ Defines the parameters of the **CharacteristicReadReq** event received by the se ...@@ -3040,13 +3035,13 @@ Defines the parameters of the **CharacteristicReadReq** event received by the se
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------ | ------ | ---- | ---- | ---------------------------------------- |
| deviceId | string | Yes| No| Address of the remote device that sends the **CharacteristicReadReq** event, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device that sends the **CharacteristicReadReq** event, for example, XX:XX:XX:XX:XX:XX.|
| transId | number | Yes| No| Transmission ID of the read request. The response returned by the server must use the same transmission ID.| | transId | number | Yes | No | Transmission ID of the read request. The response returned by the server must use the same transmission ID. |
| offset | number | Yes| No| Position from which the characteristic value is read. For example, **k** means to read from the kth byte. The response returned by the server must use the same offset.| | offset | number | Yes | No | Position from which the characteristic value is read. For example, **k** means to read from the kth byte. The response returned by the server must use the same offset.|
| characteristicUuid | string | Yes| No| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | No | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| serviceUuid | string | Yes| No| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | No | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
## CharacteristicWriteReq ## CharacteristicWriteReq
...@@ -3055,15 +3050,14 @@ Defines the parameters of the **CharacteristicWriteReq** event received by the s ...@@ -3055,15 +3050,14 @@ Defines the parameters of the **CharacteristicWriteReq** event received by the s
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------ | ------ | ---- | ---- | ---------------------------------------- |
| deviceId | string | Yes| No| Address of the remote device that sends the **CharacteristicWriteReq** event, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device that sends the **CharacteristicWriteReq** event, for example, XX:XX:XX:XX:XX:XX.|
| transId | number | Yes| No| Transmission ID of the write request. The response returned by the server must use the same transmission ID.| | transId | number | Yes | No | Transmission ID of the write request. The response returned by the server must use the same transmission ID. |
| offset | number | Yes| No| Start position for writing the characteristic value. For example, **k** means to write from the kth byte. The response returned by the server must use the same offset.| | offset | number | Yes | No | Start position for writing the characteristic value. For example, **k** means to write from the kth byte. The response returned by the server must use the same offset.|
| descriptorUuid | string | Yes| No| UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.| | descriptorUuid | string | Yes | No | UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| No| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | No | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| serviceUuid | string | Yes| No| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | No | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
## DescriptorReadReq ## DescriptorReadReq
...@@ -3071,14 +3065,14 @@ Defines the parameters of the **DescriptorReadReq** event received by the server ...@@ -3071,14 +3065,14 @@ Defines the parameters of the **DescriptorReadReq** event received by the server
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------ | ------ | ---- | ---- | ---------------------------------------- |
| deviceId | string | Yes| No| Address of the remote device that sends a **DescriptorReadReq** event, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device that sends a **DescriptorReadReq** event, for example, XX:XX:XX:XX:XX:XX.|
| transId | number | Yes| No| Transmission ID of the read request. The response returned by the server must use the same transmission ID.| | transId | number | Yes | No | Transmission ID of the read request. The response returned by the server must use the same transmission ID. |
| offset | number | Yes| No| Position from which the descriptor is read. For example, **k** means to read from the kth byte. The response returned by the server must use the same offset.| | offset | number | Yes | No | Position from which the descriptor is read. For example, **k** means to read from the kth byte. The response returned by the server must use the same offset.|
| descriptorUuid | string | Yes| No| UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.| | descriptorUuid | string | Yes | No | UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| No| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | No | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| serviceUuid | string | Yes| No| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | No | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
## DescriptorWriteReq ## DescriptorWriteReq
...@@ -3087,17 +3081,17 @@ Defines the parameters of the **DescriptorWriteReq** event received by the serve ...@@ -3087,17 +3081,17 @@ Defines the parameters of the **DescriptorWriteReq** event received by the serve
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------------ | ----------- | ---- | ---- | ---------------------------------------- |
| deviceId | string | Yes| No| Address of the remote device that sends a **DescriptorWriteReq** event, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device that sends a **DescriptorWriteReq** event, for example, XX:XX:XX:XX:XX:XX.|
| transId | number | Yes| No| Transmission ID of the write request. The response returned by the server must use the same transmission ID.| | transId | number | Yes | No | Transmission ID of the write request. The response returned by the server must use the same transmission ID. |
| offset | number | Yes| No| Start position for writing the descriptor. For example, **k** means to write from the kth byte. The response returned by the server must use the same offset.| | offset | number | Yes | No | Start position for writing the descriptor. For example, **k** means to write from the kth byte. The response returned by the server must use the same offset.|
| isPrep | boolean | Yes| No| Whether the write request is executed immediately.| | isPrep | boolean | Yes | No | Whether the write request is executed immediately. |
| needRsp | boolean | Yes| No| Whether to send a response to the GATT client.| | needRsp | boolean | Yes | No | Whether to send a response to the GATT client. |
| value | ArrayBuffer | Yes| No| Binary value of the descriptor to write.| | value | ArrayBuffer | Yes | No | Binary value of the descriptor to write. |
| descriptorUuid | string | Yes| No| UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.| | descriptorUuid | string | Yes | No | UUID of the descriptor, for example, **00002902-0000-1000-8000-00805f9b34fb**.|
| characteristicUuid | string | Yes| No| UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.| | characteristicUuid | string | Yes | No | UUID of the characteristic, for example, **00002a11-0000-1000-8000-00805f9b34fb**.|
| serviceUuid | string | Yes| No| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | No | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
## ServerResponse ## ServerResponse
...@@ -3106,13 +3100,13 @@ Defines the parameters of the server's response to the GATT client's read/write ...@@ -3106,13 +3100,13 @@ Defines the parameters of the server's response to the GATT client's read/write
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ----------- | ---- | ---- | -------------------------------------- |
| deviceId | string | Yes| No| Address of the remote device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device, for example, XX:XX:XX:XX:XX:XX. |
| transId | number | Yes| No| Transmission ID of the request. The value must be the same as the ID carried in the read/write request received.| | transId | number | Yes | No | Transmission ID of the request. The value must be the same as the ID carried in the read/write request received. |
| status | number | Yes| No| Response state. Set this parameter to **0**, which indicates a normal response.| | status | number | Yes | No | Response state. Set this parameter to **0**, which indicates a normal response. |
| offset | number | Yes| No| Start read/write position. The value must be the same as the offset carried in the read/write request.| | offset | number | Yes | No | Start read/write position. The value must be the same as the offset carried in the read/write request.|
| value | ArrayBuffer | Yes| No| Binary data in the response.| | value | ArrayBuffer | Yes | No | Binary data in the response. |
## BLEConnectChangedState ## BLEConnectChangedState
...@@ -3121,10 +3115,10 @@ Defines the parameters of **BLEConnectChangedState**. ...@@ -3121,10 +3115,10 @@ Defines the parameters of **BLEConnectChangedState**.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---- | -------------------------------- |
| deviceId | string | Yes| No| Address of the remote device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the remote device, for example, XX:XX:XX:XX:XX:XX.|
| state | [ProfileConnectionState](#profileconnectionState) | Yes| Yes| BLE connection state.| | state | [ProfileConnectionState](#profileconnectionState) | Yes | Yes | BLE connection state. |
## ProfileConnectionState ## ProfileConnectionState
...@@ -3133,12 +3127,12 @@ Enumerates the profile connection states. ...@@ -3133,12 +3127,12 @@ Enumerates the profile connection states.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ------------------- | ---- | -------------- |
| STATE_DISCONNECTED | 0 | Disconnected.| | STATE_DISCONNECTED | 0 | Disconnected. |
| STATE_CONNECTING | 1 | Connecting.| | STATE_CONNECTING | 1 | Connecting.|
| STATE_CONNECTED | 2 | Connected.| | STATE_CONNECTED | 2 | Connected. |
| STATE_DISCONNECTING | 3 | Disconnecting.| | STATE_DISCONNECTING | 3 | Disconnecting.|
## ScanFilter ## ScanFilter
...@@ -3147,11 +3141,11 @@ Defines the scan filter parameters. ...@@ -3147,11 +3141,11 @@ Defines the scan filter parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----------- | ------ | ---- | ---- | ---------------------------------------- |
| deviceId | string | Yes| Yes| Address of the BLE device to filter, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | Yes | Address of the BLE device to filter, for example, XX:XX:XX:XX:XX:XX. |
| name | string | Yes| Yes| Name of the BLE device to filter.| | name | string | Yes | Yes | Name of the BLE device to filter. |
| serviceUuid | string | Yes| Yes| UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.| | serviceUuid | string | Yes | Yes | UUID of the service, for example, **00001888-0000-1000-8000-00805f9b34fb**.|
## ScanOptions ## ScanOptions
...@@ -3160,11 +3154,11 @@ Defines the scan configuration parameters. ...@@ -3160,11 +3154,11 @@ Defines the scan configuration parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------- | ----------------------- | ---- | ---- | -------------------------------------- |
| interval | number | Yes| Yes| Delay in reporting the scan result. The default value is **0**.| | interval | number | Yes | Yes | Delay in reporting the scan result. The default value is **0**. |
| dutyMode | [ScanDuty](#scanduty) | Yes| Yes| Scan duty. The default value is **SCAN_MODE_LOW_POWER**.| | dutyMode | [ScanDuty](#scanduty) | Yes | Yes | Scan duty. The default value is **SCAN_MODE_LOW_POWER**. |
| matchMode | [MatchMode](#matchmode) | Yes| Yes| Hardware filtering match mode. The default value is **MATCH_MODE_AGGRESSIVE**.| | matchMode | [MatchMode](#matchmode) | Yes | Yes | Hardware filtering match mode. The default value is **MATCH_MODE_AGGRESSIVE**.|
## ScanDuty ## ScanDuty
...@@ -3173,11 +3167,11 @@ Enumerates the scan duty options. ...@@ -3173,11 +3167,11 @@ Enumerates the scan duty options.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | --------------------- | ---- | ------------ |
| SCAN_MODE_LOW_POWER | 0 | Low-power mode, which is the default value.| | SCAN_MODE_LOW_POWER | 0 | Low-power mode, which is the default value.|
| SCAN_MODE_BALANCED | 1 | Balanced mode.| | SCAN_MODE_BALANCED | 1 | Balanced mode. |
| SCAN_MODE_LOW_LATENCY | 2 | Low-latency mode.| | SCAN_MODE_LOW_LATENCY | 2 | Low-latency mode. |
## MatchMode ## MatchMode
...@@ -3186,10 +3180,10 @@ Enumerates the hardware match modes of BLE scan filters. ...@@ -3186,10 +3180,10 @@ Enumerates the hardware match modes of BLE scan filters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | --------------------- | ---- | ---------------------------------------- |
| MATCH_MODE_AGGRESSIVE | 1 | Hardware reports the scan result with a lower threshold of signal strength and few number of matches in a duration. This is the default value.| | MATCH_MODE_AGGRESSIVE | 1 | Hardware reports the scan result with a lower threshold of signal strength and few number of matches in a duration. This is the default value.|
| MATCH_MODE_STICKY | 2 | Hardware reports the scan result with a higher threshold of signal strength and sightings.| | MATCH_MODE_STICKY | 2 | Hardware reports the scan result with a higher threshold of signal strength and sightings. |
## ScanResult ## ScanResult
...@@ -3198,11 +3192,11 @@ Defines the scan result. ...@@ -3198,11 +3192,11 @@ Defines the scan result.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ----------- | ---- | ---- | ---------------------------------- |
| deviceId | string | Yes| No| Address of the scanned device, for example, XX:XX:XX:XX:XX:XX.| | deviceId | string | Yes | No | Address of the scanned device, for example, XX:XX:XX:XX:XX:XX.|
| rssi | number | Yes| No| RSSI of the device.| | rssi | number | Yes | No | RSSI of the device. |
| data | ArrayBuffer | Yes| No| Advertisement packets sent by the device.| | data | ArrayBuffer | Yes | No | Advertisement packets sent by the device. |
## BluetoothState ## BluetoothState
...@@ -3211,15 +3205,15 @@ Enumerates the Bluetooth states. ...@@ -3211,15 +3205,15 @@ Enumerates the Bluetooth states.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | --------------------- | ---- | ------------------ |
| STATE_OFF | 0 | Bluetooth is turned off.| | STATE_OFF | 0 | Bluetooth is turned off. |
| STATE_TURNING_ON | 1 | Bluetooth is being turned on.| | STATE_TURNING_ON | 1 | Bluetooth is being turned on. |
| STATE_ON | 2 | Bluetooth is turned on.| | STATE_ON | 2 | Bluetooth is turned on. |
| STATE_TURNING_OFF | 3 | Bluetooth is being turned off.| | STATE_TURNING_OFF | 3 | Bluetooth is being turned off. |
| STATE_BLE_TURNING_ON | 4 | The LE-only mode is being turned on for Bluetooth.| | STATE_BLE_TURNING_ON | 4 | The LE-only mode is being turned on for Bluetooth.|
| STATE_BLE_ON | 5 | Bluetooth is in LE-only mode.| | STATE_BLE_ON | 5 | Bluetooth is in LE-only mode. |
| STATE_BLE_TURNING_OFF | 6 | The LE-only mode is being turned off for Bluetooth.| | STATE_BLE_TURNING_OFF | 6 | The LE-only mode is being turned off for Bluetooth.|
## AdvertiseSetting ## AdvertiseSetting
...@@ -3228,11 +3222,11 @@ Defines the BLE advertising parameters. ...@@ -3228,11 +3222,11 @@ Defines the BLE advertising parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ----------- | ------- | ---- | ---- | ---------------------------------------- |
| interval | number | Yes| Yes| Interval for BLE advertising. The minimum value is **32** slots (20 ms). The maximum value is **16777215** slots. The default value is **1600** slots (1s).| | interval | number | Yes | Yes | Interval for BLE advertising. The minimum value is **32** slots (20 ms). The maximum value is **16777215** slots. The default value is **1600** slots (1s).|
| txPower | number | Yes| Yes| Transmit power, in dBm. The value range is –127 to 1. The default value is **–7**.| | txPower | number | Yes | Yes | Transmit power, in dBm. The value range is -127 to 1. The default value is **-7**. |
| connectable | boolean | Yes| Yes| Whether the advertisement is connectable. The default value is **true**.| | connectable | boolean | Yes | Yes | Whether the advertisement is connectable. The default value is **true**. |
## AdvertiseData ## AdvertiseData
...@@ -3241,11 +3235,11 @@ Defines the content of a BLE advertisement packet. ...@@ -3241,11 +3235,11 @@ Defines the content of a BLE advertisement packet.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------------- | ---------------------------------------- | ---- | ---- | --------------------------- |
| serviceUuids | Array&lt;string&gt; | Yes| Yes| List of service UUIDs to broadcast.| | serviceUuids | Array&lt;string&gt; | Yes | Yes | List of service UUIDs to broadcast.|
| manufactureData | Array&lt;[ManufactureData](#manufacturedata)&gt; | Yes| Yes| List of manufacturers to broadcast.| | manufactureData | Array&lt;[ManufactureData](#manufacturedata)&gt; | Yes | Yes | List of manufacturers to broadcast. |
| serviceData | Array&lt;[ServiceData](#servicedata)&gt; | Yes| Yes| List of service data to broadcast.| | serviceData | Array&lt;[ServiceData](#servicedata)&gt; | Yes | Yes | List of service data to broadcast. |
## ManufactureData ## ManufactureData
...@@ -3254,10 +3248,10 @@ Defines the content of a BLE advertisement packet. ...@@ -3254,10 +3248,10 @@ Defines the content of a BLE advertisement packet.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ---------------- | ------------------- | ---- | ---- | ------------------ |
| manufactureId | Array&lt;string&gt; | Yes| Yes| Manufacturer ID allocated by the Bluetooth SIG.| | manufactureId | Array&lt;string&gt; | Yes | Yes | Manufacturer ID allocated by the Bluetooth SIG.|
| manufactureValue | ArrayBuffer | Yes| Yes| Manufacturer data.| | manufactureValue | ArrayBuffer | Yes | Yes | Manufacturer data. |
## ServiceData ## ServiceData
...@@ -3266,10 +3260,10 @@ Defines the service data contained in an advertisement packet. ...@@ -3266,10 +3260,10 @@ Defines the service data contained in an advertisement packet.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | ------------ | ----------- | ---- | ---- | ---------- |
| serviceUuid | string | Yes| Yes| Service UUID.| | serviceUuid | string | Yes | Yes | Service UUID.|
| serviceValue | ArrayBuffer | Yes| Yes| Service data.| | serviceValue | ArrayBuffer | Yes | Yes | Service data. |
## PinRequiredParam<sup>8+</sup><a name="PinRequiredParam"></a> ## PinRequiredParam<sup>8+</sup><a name="PinRequiredParam"></a>
...@@ -3278,10 +3272,10 @@ Defines the pairing request parameters. ...@@ -3278,10 +3272,10 @@ Defines the pairing request parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ------ | ---- | ---- | ----------- |
| deviceId | string | Yes| No| ID of the device to pair.| | deviceId | string | Yes | No | ID of the device to pair.|
| pinCode | string | Yes| No| Key for the device pairing.| | pinCode | string | Yes | No | Key for the device pairing. |
## StateChangeParam<sup>8+</sup><a name="StateChangeParam"></a> ## StateChangeParam<sup>8+</sup><a name="StateChangeParam"></a>
...@@ -3290,10 +3284,10 @@ Defines the profile state change parameters. ...@@ -3290,10 +3284,10 @@ Defines the profile state change parameters.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | ---------------------------------------- | ---- | ---- | ------------------- |
| deviceId | string | Yes| No| Address of a Bluetooth device.| | deviceId | string | Yes | No | Address of a Bluetooth device. |
| state | [ProfileConnectionState](#ProfileConnectionState) | Yes| No| Profile connection state of the device.| | state | [ProfileConnectionState](#ProfileConnectionState) | Yes | No | Profile connection state of the device.|
## DeviceClass<sup>8+</sup><a name="DeviceClass"></a> ## DeviceClass<sup>8+</sup><a name="DeviceClass"></a>
...@@ -3302,11 +3296,11 @@ Defines the class of a Bluetooth device. ...@@ -3302,11 +3296,11 @@ Defines the class of a Bluetooth device.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Type| Readable| Writable| Description| | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | --------------- | ----------------------------------- | ---- | ---- | ---------------- |
| majorClass | [MajorClass](#majorclass) | Yes| No| Major classes of Bluetooth devices.| | majorClass | [MajorClass](#majorclass) | Yes | No | Major classes of Bluetooth devices. |
| majorMinorClass | [MajorMinorClass](#majorminorclass) | Yes| No| Major and minor classes of Bluetooth devices.| | majorMinorClass | [MajorMinorClass](#majorminorclass) | Yes | No | Major and minor classes of Bluetooth devices.|
| classOfDevice | number | Yes| No| Class of the device.| | classOfDevice | number | Yes | No | Class of the device. |
...@@ -3316,19 +3310,19 @@ Enumerates the major classes of Bluetooth devices. ...@@ -3316,19 +3310,19 @@ Enumerates the major classes of Bluetooth devices.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ------------------- | ------ | ---------- |
| MAJOR_MISC | 0x0000 | Miscellaneous device.| | MAJOR_MISC | 0x0000 | Miscellaneous device. |
| MAJOR_COMPUTER | 0x0100 | Computer.| | MAJOR_COMPUTER | 0x0100 | Computer. |
| MAJOR_PHONE | 0x0200 | Mobile phone.| | MAJOR_PHONE | 0x0200 | Mobile phone. |
| MAJOR_NETWORKING | 0x0300 | Network device.| | MAJOR_NETWORKING | 0x0300 | Network device. |
| MAJOR_AUDIO_VIDEO | 0x0400 | Audio or video device.| | MAJOR_AUDIO_VIDEO | 0x0400 | Audio or video device.|
| MAJOR_PERIPHERAL | 0x0500 | Peripheral device.| | MAJOR_PERIPHERAL | 0x0500 | Peripheral device. |
| MAJOR_IMAGING | 0x0600 | Imaging device.| | MAJOR_IMAGING | 0x0600 | Imaging device. |
| MAJOR_WEARABLE | 0x0700 | Wearable device.| | MAJOR_WEARABLE | 0x0700 | Wearable device. |
| MAJOR_TOY | 0x0800 | Toy.| | MAJOR_TOY | 0x0800 | Toy. |
| MAJOR_HEALTH | 0x0900 | Health device.| | MAJOR_HEALTH | 0x0900 | Health device. |
| MAJOR_UNCATEGORIZED | 0x1F00 | Unclassified device.| | MAJOR_UNCATEGORIZED | 0x1F00 | Unclassified device. |
## MajorMinorClass<sup>8+</sup><a name="MajorMinorClass"></a> ## MajorMinorClass<sup>8+</sup><a name="MajorMinorClass"></a>
...@@ -3337,94 +3331,94 @@ Enumerates the major and minor classes of Bluetooth devices. ...@@ -3337,94 +3331,94 @@ Enumerates the major and minor classes of Bluetooth devices.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ---------------------------------------- | ------ | --------------- |
| COMPUTER_UNCATEGORIZED | 0x0100 | Unclassified computer.| | COMPUTER_UNCATEGORIZED | 0x0100 | Unclassified computer. |
| COMPUTER_DESKTOP | 0x0104 | Desktop computer.| | COMPUTER_DESKTOP | 0x0104 | Desktop computer. |
| COMPUTER_SERVER | 0x0108 | Server.| | COMPUTER_SERVER | 0x0108 | Server. |
| COMPUTER_LAPTOP | 0x010C | Laptop.| | COMPUTER_LAPTOP | 0x010C | Laptop. |
| COMPUTER_HANDHELD_PC_PDA | 0x0110 | Hand-held computer.| | COMPUTER_HANDHELD_PC_PDA | 0x0110 | Hand-held computer. |
| COMPUTER_PALM_SIZE_PC_PDA | 0x0114 | Palmtop computer.| | COMPUTER_PALM_SIZE_PC_PDA | 0x0114 | Palmtop computer. |
| COMPUTER_WEARABLE | 0x0118 | Wearable computer.| | COMPUTER_WEARABLE | 0x0118 | Wearable computer. |
| COMPUTER_TABLET | 0x011C | Tablet.| | COMPUTER_TABLET | 0x011C | Tablet. |
| PHONE_UNCATEGORIZED | 0x0200 | Unclassified mobile phone.| | PHONE_UNCATEGORIZED | 0x0200 | Unclassified mobile phone. |
| PHONE_CELLULAR | 0x0204 | Portable phone.| | PHONE_CELLULAR | 0x0204 | Portable phone. |
| PHONE_CORDLESS | 0x0208 | Cordless phone.| | PHONE_CORDLESS | 0x0208 | Cordless phone. |
| PHONE_SMART | 0x020C | Smartphone.| | PHONE_SMART | 0x020C | Smartphone. |
| PHONE_MODEM_OR_GATEWAY | 0x0210 | Modem or gateway phone.| | PHONE_MODEM_OR_GATEWAY | 0x0210 | Modem or gateway phone.|
| PHONE_ISDN | 0x0214 | ISDN phone.| | PHONE_ISDN | 0x0214 | ISDN phone. |
| NETWORK_FULLY_AVAILABLE | 0x0300 | Device with network fully available.| | NETWORK_FULLY_AVAILABLE | 0x0300 | Device with network fully available. |
| NETWORK_1_TO_17_UTILIZED | 0x0320 | Device used on network 1 to 17.| | NETWORK_1_TO_17_UTILIZED | 0x0320 | Device used on network 1 to 17. |
| NETWORK_17_TO_33_UTILIZED | 0x0340 | Device used on network 17 to 33.| | NETWORK_17_TO_33_UTILIZED | 0x0340 | Device used on network 17 to 33. |
| NETWORK_33_TO_50_UTILIZED | 0x0360 | Device used on network 33 to 50.| | NETWORK_33_TO_50_UTILIZED | 0x0360 | Device used on network 33 to 50. |
| NETWORK_60_TO_67_UTILIZED | 0x0380 | Device used on network 60 to 67.| | NETWORK_60_TO_67_UTILIZED | 0x0380 | Device used on network 60 to 67. |
| NETWORK_67_TO_83_UTILIZED | 0x03A0 | Device used on network 67 to 83.| | NETWORK_67_TO_83_UTILIZED | 0x03A0 | Device used on network 67 to 83. |
| NETWORK_83_TO_99_UTILIZED | 0x03C0 | Device used on network 83 to 99.| | NETWORK_83_TO_99_UTILIZED | 0x03C0 | Device used on network 83 to 99. |
| NETWORK_NO_SERVICE | 0x03E0 | Device without network service | NETWORK_NO_SERVICE | 0x03E0 | Device without network service |
| AUDIO_VIDEO_UNCATEGORIZED | 0x0400 | Unclassified audio or video device.| | AUDIO_VIDEO_UNCATEGORIZED | 0x0400 | Unclassified audio or video device. |
| AUDIO_VIDEO_WEARABLE_HEADSET | 0x0404 | Wearable audio or video headset.| | AUDIO_VIDEO_WEARABLE_HEADSET | 0x0404 | Wearable audio or video headset. |
| AUDIO_VIDEO_HANDSFREE | 0x0408 | Hands-free audio or video device.| | AUDIO_VIDEO_HANDSFREE | 0x0408 | Hands-free audio or video device. |
| AUDIO_VIDEO_MICROPHONE | 0x0410 | Audio or video microphone.| | AUDIO_VIDEO_MICROPHONE | 0x0410 | Audio or video microphone. |
| AUDIO_VIDEO_LOUDSPEAKER | 0x0414 | Audio or video loudspeaker.| | AUDIO_VIDEO_LOUDSPEAKER | 0x0414 | Audio or video loudspeaker. |
| AUDIO_VIDEO_HEADPHONES | 0x0418 | Audio or video headphones.| | AUDIO_VIDEO_HEADPHONES | 0x0418 | Audio or video headphones. |
| AUDIO_VIDEO_PORTABLE_AUDIO | 0x041C | Portable audio or video device.| | AUDIO_VIDEO_PORTABLE_AUDIO | 0x041C | Portable audio or video device. |
| AUDIO_VIDEO_CAR_AUDIO | 0x0420 | In-vehicle audio or video device.| | AUDIO_VIDEO_CAR_AUDIO | 0x0420 | In-vehicle audio or video device. |
| AUDIO_VIDEO_SET_TOP_BOX | 0x0424 | Audio or video STB device.| | AUDIO_VIDEO_SET_TOP_BOX | 0x0424 | Audio or video STB device. |
| AUDIO_VIDEO_HIFI_AUDIO | 0x0428 | High-fidelity speaker device.| | AUDIO_VIDEO_HIFI_AUDIO | 0x0428 | High-fidelity speaker device. |
| AUDIO_VIDEO_VCR| 0x042C | Video cassette recording (VCR) device.| | AUDIO_VIDEO_VCR | 0x042C | Video cassette recording (VCR) device. |
| AUDIO_VIDEO_VIDEO_CAMERA | 0x0430 | Camera.| | AUDIO_VIDEO_VIDEO_CAMERA | 0x0430 | Camera. |
| AUDIO_VIDEO_CAMCORDER | 0x0434 | Camcorder| | AUDIO_VIDEO_CAMCORDER | 0x0434 | Camcorder |
| AUDIO_VIDEO_VIDEO_MONITOR | 0x0438 | Audio or video monitor.| | AUDIO_VIDEO_VIDEO_MONITOR | 0x0438 | Audio or video monitor. |
| AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER | 0x043C | Video display or loudspeaker.| | AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER | 0x043C | Video display or loudspeaker. |
| AUDIO_VIDEO_VIDEO_CONFERENCING | 0x0440 | Video conferencing device.| | AUDIO_VIDEO_VIDEO_CONFERENCING | 0x0440 | Video conferencing device. |
| AUDIO_VIDEO_VIDEO_GAMING_TOY | 0x0448 | Audio or video gaming toy.| | AUDIO_VIDEO_VIDEO_GAMING_TOY | 0x0448 | Audio or video gaming toy. |
| PERIPHERAL_NON_KEYBOARD_NON_POINTING | 0x0500 | Non-keyboard or non-pointing peripheral device.| | PERIPHERAL_NON_KEYBOARD_NON_POINTING | 0x0500 | Non-keyboard or non-pointing peripheral device. |
| PERIPHERAL_KEYBOARD | 0x0540 | Keyboard device.| | PERIPHERAL_KEYBOARD | 0x0540 | Keyboard device. |
| PERIPHERAL_POINTING_DEVICE | 0x0580 | Pointing peripheral device.| | PERIPHERAL_POINTING_DEVICE | 0x0580 | Pointing peripheral device. |
| PERIPHERAL_KEYBOARD_POINTING| 0x05C0 | Keyboard pointing device.| | PERIPHERAL_KEYBOARD_POINTING | 0x05C0 | Keyboard pointing device. |
| PERIPHERAL_UNCATEGORIZED | 0x0500 | Unclassified peripheral device.| | PERIPHERAL_UNCATEGORIZED | 0x0500 | Unclassified peripheral device. |
| PERIPHERAL_JOYSTICK | 0x0504 | Peripheral joystick.| | PERIPHERAL_JOYSTICK | 0x0504 | Peripheral joystick. |
| PERIPHERAL_GAMEPAD | 0x0508 | Peripheral game pad| | PERIPHERAL_GAMEPAD | 0x0508 | Peripheral game pad |
| PERIPHERAL_REMOTE_CONTROL | 0x05C0 | Peripheral remote control device| | PERIPHERAL_REMOTE_CONTROL | 0x05C0 | Peripheral remote control device |
| PERIPHERAL_SENSING_DEVICE | 0x0510 | Peripheral sensing device.| | PERIPHERAL_SENSING_DEVICE | 0x0510 | Peripheral sensing device. |
| PERIPHERAL_DIGITIZER_TABLET | 0x0514 | Peripheral digitizer tablet.| | PERIPHERAL_DIGITIZER_TABLET | 0x0514 | Peripheral digitizer tablet.|
| PERIPHERAL_CARD_READER | 0x0518 | Peripheral card reader.| | PERIPHERAL_CARD_READER | 0x0518 | Peripheral card reader. |
| PERIPHERAL_DIGITAL_PEN | 0x051C | Peripheral digital pen.| | PERIPHERAL_DIGITAL_PEN | 0x051C | Peripheral digital pen. |
| PERIPHERAL_SCANNER_RFID | 0x0520 | Peripheral RFID scanner.| | PERIPHERAL_SCANNER_RFID | 0x0520 | Peripheral RFID scanner. |
| PERIPHERAL_GESTURAL_INPUT | 0x0522 | Gesture input device.| | PERIPHERAL_GESTURAL_INPUT | 0x0522 | Gesture input device. |
| IMAGING_UNCATEGORIZED | 0x0600 | Unclassified imaging device.| | IMAGING_UNCATEGORIZED | 0x0600 | Unclassified imaging device. |
| IMAGING_DISPLAY | 0x0610 | Imaging display device.| | IMAGING_DISPLAY | 0x0610 | Imaging display device. |
| IMAGING_CAMERA | 0x0620 | Imaging camera device.| | IMAGING_CAMERA | 0x0620 | Imaging camera device. |
| IMAGING_SCANNER | 0x0640 | Imaging scanner.| | IMAGING_SCANNER | 0x0640 | Imaging scanner. |
| IMAGING_PRINTER | 0x0680 | Imaging printer.| | IMAGING_PRINTER | 0x0680 | Imaging printer. |
| WEARABLE_UNCATEGORIZED | 0x0700 | Unclassified wearable device.| | WEARABLE_UNCATEGORIZED | 0x0700 | Unclassified wearable device. |
| WEARABLE_WRIST_WATCH | 0x0704 | Smart watch.| | WEARABLE_WRIST_WATCH | 0x0704 | Smart watch. |
| WEARABLE_PAGER | 0x0708 | Wearable pager.| | WEARABLE_PAGER | 0x0708 | Wearable pager. |
| WEARABLE_JACKET | 0x070C | Smart jacket.| | WEARABLE_JACKET | 0x070C | Smart jacket. |
| WEARABLE_HELMET | 0x0710 | Wearable helmet.| | WEARABLE_HELMET | 0x0710 | Wearable helmet. |
| WEARABLE_GLASSES | 0x0714 | Wearable glasses.| | WEARABLE_GLASSES | 0x0714 | Wearable glasses. |
| TOY_UNCATEGORIZED | 0x0800 | Unclassified toy.| | TOY_UNCATEGORIZED | 0x0800 | Unclassified toy. |
| TOY_ROBOT| 0x0804 | Toy robot.| | TOY_ROBOT | 0x0804 | Toy robot. |
| TOY_VEHICLE | 0x0808 | Toy vehicle.| | TOY_VEHICLE | 0x0808 | Toy vehicle. |
| TOY_DOLL_ACTION_FIGURE | 0x080C | Humanoid toy doll.| | TOY_DOLL_ACTION_FIGURE | 0x080C | Humanoid toy doll. |
| TOY_CONTROLLER | 0x0810 | Toy controller.| | TOY_CONTROLLER | 0x0810 | Toy controller. |
| TOY_GAME | 0x0814 | Toy gaming device.| | TOY_GAME | 0x0814 | Toy gaming device. |
| HEALTH_UNCATEGORIZED | 0x0900 | Unclassified health devices.| | HEALTH_UNCATEGORIZED | 0x0900 | Unclassified health devices. |
| HEALTH_BLOOD_PRESSURE | 0x0904 | Blood pressure device.| | HEALTH_BLOOD_PRESSURE | 0x0904 | Blood pressure device. |
| HEALTH_THERMOMETER | 0x0908 | Thermometer| | HEALTH_THERMOMETER | 0x0908 | Thermometer |
| HEALTH_WEIGHING | 0x090C | Body scale.| | HEALTH_WEIGHING | 0x090C | Body scale. |
| HEALTH_GLUCOSE | 0x0910 | Blood glucose monitor.| | HEALTH_GLUCOSE | 0x0910 | Blood glucose monitor. |
| HEALTH_PULSE_OXIMETER | 0x0914 | Pulse oximeter.| | HEALTH_PULSE_OXIMETER | 0x0914 | Pulse oximeter. |
| HEALTH_PULSE_RATE | 0x0918 | Heart rate monitor.| | HEALTH_PULSE_RATE | 0x0918 | Heart rate monitor. |
| HEALTH_DATA_DISPLAY | 0x091C | Health data display.| | HEALTH_DATA_DISPLAY | 0x091C | Health data display. |
| HEALTH_STEP_COUNTER | 0x0920 | Step counter.| | HEALTH_STEP_COUNTER | 0x0920 | Step counter. |
| HEALTH_BODY_COMPOSITION_ANALYZER | 0x0924 | Body composition analyzer.| | HEALTH_BODY_COMPOSITION_ANALYZER | 0x0924 | Body composition analyzer. |
| HEALTH_PEAK_FLOW_MOITOR | 0x0928 | Hygrometer.| | HEALTH_PEAK_FLOW_MOITOR | 0x0928 | Hygrometer. |
| HEALTH_MEDICATION_MONITOR | 0x092C | Medication monitor.| | HEALTH_MEDICATION_MONITOR | 0x092C | Medication monitor. |
| HEALTH_KNEE_PROSTHESIS | 0x0930 | Prosthetic knee.| | HEALTH_KNEE_PROSTHESIS | 0x0930 | Prosthetic knee. |
| HEALTH_ANKLE_PROSTHESIS | 0x0934 | Prosthetic ankle.| | HEALTH_ANKLE_PROSTHESIS | 0x0934 | Prosthetic ankle. |
| HEALTH_GENERIC_HEALTH_MANAGER | 0x0938 | Generic health management device.| | HEALTH_GENERIC_HEALTH_MANAGER | 0x0938 | Generic health management device. |
| HEALTH_PERSONAL_MOBILITY_DEVICE | 0x093C | Personal mobility device.| | HEALTH_PERSONAL_MOBILITY_DEVICE | 0x093C | Personal mobility device. |
## PlayingState<sup>8+</sup><a name="PlayingState"></a> ## PlayingState<sup>8+</sup><a name="PlayingState"></a>
...@@ -3433,10 +3427,10 @@ Enumerates the A2DP playing states. ...@@ -3433,10 +3427,10 @@ Enumerates the A2DP playing states.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ----------------- | ------ | ------- |
| STATE_NOT_PLAYING | 0x0000 | Not playing.| | STATE_NOT_PLAYING | 0x0000 | Not playing. |
| STATE_PLAYING | 0x0001 | Playing.| | STATE_PLAYING | 0x0001 | Playing.|
## ProfileId<sup>8+</sup><a name="ProfileId"></a> ## ProfileId<sup>8+</sup><a name="ProfileId"></a>
...@@ -3445,7 +3439,7 @@ Enumerates the Bluetooth profile IDs. ...@@ -3445,7 +3439,7 @@ Enumerates the Bluetooth profile IDs.
**System capability**: SystemCapability.Communication.Bluetooth.Core **System capability**: SystemCapability.Communication.Bluetooth.Core
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | -------------------------------- | ------ | --------------- |
| PROFILE_A2DP_SOURCE | 0x0001 | A2DP profile.| | PROFILE_A2DP_SOURCE | 0x0001 | A2DP profile.|
| PROFILE_HANDS_FREE_AUDIO_GATEWAY | 0x0004 | HFP profile.| | PROFILE_HANDS_FREE_AUDIO_GATEWAY | 0x0004 | HFP profile. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册