getDeviceOnlineType
Requires:
DeviceKit≥2.1.4@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
Method signature
getDeviceOnlineType(params: )Minimum SDK versions
- iOS
ThingSmartDeviceKitBizBundle - ≥ 5.2.0
- Android
com.thingclips.smart:thingsmart-bizbundle-devicekit - ≥ 5.2.0
Description
Check whether a specific channel of the device is online
Parameters
| Property | Type | Required | Description | Minimum SDK versions |
|---|---|---|---|---|
deviceId | string | Yes | deviceId device ID Supports fetching other devices’ information across panels; the current panel can pass the current device’s ID to retrieve it | — |
dps | Record<string, Record<string, any>> | No | dps | — |
complete | () => void | No | Completion callback (executed on both success and failure) | — |
success | (params: Object) => void | No | Callback on successful API call | — |
fail | (params: Object) => void | No | Failure callback | — |
success callback parameters
| Property | Type | Description | DeviceKit Since | Minimum SDK versions |
|---|---|---|---|---|
onlineType | number | Device network online types represented as bit flags; use bitwise checks. Usage: (onlineType & (1 << bit)). For example, (onlineType & (1 << 0)) == true means the device is Wi‑Fi online; (onlineType & (1 << 2)) == true means the device is Bluetooth online. Definitions: bit 0 (1 << 0): Wi‑Fi online (Cloud online || LAN online). If you only need cloud online, use bit 7 bit 1 (1 << 1): Local online (LAN online) bit 2 (1 << 2): BLE online (Bluetooth online) bit 3 (1 << 3): BLEMesh online (Bluetooth Mesh online) bit 4 (1 << 4): Beacon online bit 5 (1 << 5): Dayu online bit 6 (1 << 6): System BT online (System Bluetooth online) bit 7 (1 << 7): Cloud online bit 8 (1 << 8): Matter online (Matter local online) | v3.3.0 | — |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None