disconnectBluetoothDevice(params: Object)
Requires:
DeviceKit≥3.1.0@ray-js/ray≥0.8.0
Platforms:
iOSAndroid
Description
Aggregated Bluetooth disconnect API; supports ble, ble in dual-mode, mesh single-live-wire and mesh disconnections. Calling this on beacon devices has no effect.
Parameters
| Property | Type | Required | Default | Description | DeviceKit Since |
|---|---|---|---|---|---|
devId | string | Yes | - | Device ID | - |
connectType | number | No | 0 | Bluetooth connection mode (default: 0) 0: Gateway and app. Default mode; effective if either the local or gateway path is available. 1: App only. Only checks whether the device is locally online and whether the local connection succeeds. 2: Gateway only. Only checks whether the gateway is online and whether the gateway connection succeeds. | v3.1.2 |
complete | () => void | No | - | Completion callback (executed on both success and failure) | - |
success | () => void | No | - | Callback on successful API call | - |
fail | (params: Object) => void | No | - | Failure callback | - |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None