| 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 for the **bluetoothDeviceFind** event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -576,7 +577,7 @@ Unsubscribes from the pairing request events of the remote Bluetooth device.
...
@@ -576,7 +577,7 @@ 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 for the **pinRequired** event. The input parameter is the pairing request parameter. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth bond state change event.|
| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth paring state change event. |
| callback | Callback<[BondStateParam](#bondstateparam8)> | Yes | Callback invoked to return the bond state. You need to implement this callback. |
| callback | Callback<[BondStateParam](#bondstateparam8)> | Yes | Callback invoked to return the paring state. You need to implement this callback. |
**Return value**
**Return value**
...
@@ -617,7 +618,7 @@ No value is returned.
...
@@ -617,7 +618,7 @@ No value is returned.
**Example**
**Example**
```js
```js
functiononReceiveEvent(data){// data, as the input parameter of the callback, indicates the bond state.
functiononReceiveEvent(data){// data, as the input parameter of the callback, indicates the pairing state.
console.info('pair state = '+JSON.stringify(data));
console.info('pair state = '+JSON.stringify(data));
| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth bond state change event. |
| type | string | Yes | Event type. The value **bondStateChange** indicates a Bluetooth pairing state change event. |
| callback | Callback<[BondStateParam](#bondstateparam8)> | No | Callback used to report the change of the Bluetooth bond state. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
| callback | Callback<[BondStateParam](#bondstateparam8)> | No | Callback for the pairing state change event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -702,7 +703,7 @@ Unsubscribes from the Bluetooth connection state change events.
...
@@ -702,7 +703,7 @@ 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 for the Bluetooth connection state event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -987,7 +988,7 @@ Unsubscribes from the SPP read request events.
...
@@ -987,7 +988,7 @@ Unsubscribes from the SPP read request events.
| 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 for the SPP read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -1219,7 +1220,7 @@ Unsubscribes from the BLE device discovery events.
...
@@ -1219,7 +1220,7 @@ 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 for the **BLEDeviceFind** event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -1257,10 +1258,9 @@ No value is returned.
...
@@ -1257,10 +1258,9 @@ No value is returned.
**Return value**
**Return value**
| | |
| ------------------- | ------------- |
| Type | Description |
| Type | Description |
| Array<string> | Addresses of the connected devices. |
| ------------------- | ------------- |
| Array<string> | Addresses of the connected devices.|
| 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 for the characteristic read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -2010,7 +2002,7 @@ Unsubscribes from the characteristic write request events.
...
@@ -2010,7 +2002,7 @@ 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 for the characteristic write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -2087,7 +2079,7 @@ Unsubscribes from the descriptor read request events.
...
@@ -2087,7 +2079,7 @@ 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 for the descriptor read request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -2167,7 +2159,7 @@ Unsubscribes from the descriptor write request events.
...
@@ -2167,7 +2159,7 @@ 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 write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**.|
| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | No | Callback for the descriptor write request event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -2230,7 +2222,7 @@ Unsubscribes from the BLE connection state change events.
...
@@ -2230,7 +2222,7 @@ Unsubscribes from 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 for the BLE connection state event. If this parameter is not set, this method unsubscribes from all callbacks corresponding to **type**. |
**Return value**
**Return value**
...
@@ -2467,10 +2459,9 @@ Reads the characteristic value of the specific service of the remote BLE device.
...
@@ -2467,10 +2459,9 @@ Reads the characteristic value of the specific service of the remote BLE device.