| 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.
| 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<Array<string>> | 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<Array<string>> | 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.
| 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<[PinRequiredParam](#pinrequiredparam)> | Yes| Callback invoked to return the pairing request. You need to implement this callback.|
| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | 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.
| 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<[PinRequiredParam](#pinrequiredparam)> | 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<[PinRequiredParam](#pinrequiredparam)> | 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.
| 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<[BondStateParam](#bondstate)> | 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<[BondStateParam](#bondstate)> | 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.
| 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<[BluetoothState](#bluetoothstate)> | Yes| Callback invoked to return the Bluetooth connection state. You need to implement this callback.|
| callback | Callback<[BluetoothState](#bluetoothstate)> | 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.
| 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<[BluetoothState](#bluetoothstate)> | 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<[BluetoothState](#bluetoothstate)> | 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.
| 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<ArrayBuffer> | 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<ArrayBuffer> | 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**.|
| 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.|
| [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<string> | Addresses of the BLE devices connected to this device.|
| Array<string> | Addresses of the BLE devices connected to this device.|
| filters | Array<[ScanFilter](#scanfilter)> | Yes| Criteria for filtering the scan result. Set this parameter to **null** if you do not want to filter the scan result.|
| filters | Array<[ScanFilter](#scanfilter)> | Yes| Criteria for filtering the scan result. Set this parameter to **null** if you do not want to filter the scan result.|
| 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<Array<[ScanResult](#scanresult)>> | Yes| Callback invoked to return the discovered devices. You need to implement this callback.|
| callback | Callback<Array<[ScanResult](#scanresult)>> | 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.
| 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<Array<[ScanResult](#scanresult)>> | 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<Array<[ScanResult](#scanresult)>> | 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**
...
@@ -1220,7 +1216,7 @@ No value is returned.
...
@@ -1220,7 +1216,7 @@ No value is returned.
**Return value**
**Return value**
| | |
| | |
| -------- | -------- |
| ------------------- | ------------- |
| Type | Description |
| Type | Description |
| Array<string> | List of addresses of the connected devices. |
| Array<string> | 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.|
| 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<[CharacteristicReadReq](#characteristicreadreq)> | Yes| Callback invoked to return a characteristic read request from the GATT client.|
| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | 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.
| 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<[CharacteristicReadReq](#characteristicreadreq)> | 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<[CharacteristicReadReq](#characteristicreadreq)> | 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.
| 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<[DescriptorWriteReq](#descriptorwritereq)> | Yes| Callback invoked to return a characteristic write request from the GATT client.|
| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 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.
| 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<[CharacteristicWriteReq](#characteristicwritereq)> | 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<[CharacteristicWriteReq](#characteristicwritereq)> | 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.
| 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<[DescriptorReadReq](#descriptorreadreq)> | Yes| Callback invoked to return a characteristic read request from the GATT client.|
| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | 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.
| 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<[DescriptorReadReq](#descriptorreadreq)> | 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<[DescriptorReadReq](#descriptorreadreq)> | 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.
| 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<[DescriptorWriteReq](#descriptorwritereq)> | Yes| Callback invoked to return a characteristic write request from the GATT client.|
| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 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.
| 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<[DescriptorWriteReq](#descriptorwritereq)> | 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<[DescriptorWriteReq](#descriptorwritereq)> | 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.
| 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<[BLEConnectChangedState](#bleconnectchangedstate)> | 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<[BLEConnectChangedState](#bleconnectchangedstate)> | 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
| 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
| 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<[BLECharacteristic](#blecharacteristic)> | 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<[BLECharacteristic](#blecharacteristic)> | 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.
| 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<[BLEConnectChangedState](#bleconnectchangedstate)> | 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<[BLEConnectChangedState](#bleconnectchangedstate)> | 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
| 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
| 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
| 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
| 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
| 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
| 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. |
| 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.