---
name: "getSubDeviceInfoList"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "1.2.6" }
  - { name: "@ray-js/ray", version: "0.6.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getSubDeviceInfoList

> [VERSION] DeviceKit >= 1.2.6 | @ray-js/ray >= 0.6.23

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get sub-device information

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `meshId` | `string` | Yes | - | `1.2.6` | Gateway device ID or parent node ID |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `(params: DeviceInfo[]) => void` | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension message |


### Referenced Types

##### `interface` DeviceInfo

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `roomName` | `string` | `3.6.0` | Name of the room the device is in |
| `schema` | `Record<string, any>[]` | `3.3.0` | Product information; includes schema and function definitions |
| `dps` | `Record<string, Record<string, any>>` | `3.3.0` | dps Device DP states; use the corresponding dpid to get specific values for business logic |
| `attribute` | `number` | `3.3.0` | attribute Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |
| `baseAttribute` | `number` | `3.5.0` | baseAttribute Basic product attribute definitions |
| `capability` | `number` | `3.3.0` | capability Product capability value. On the backend-ng platform you can query the corresponding selections; overall business logic is partitioned based on this data. Device types can also be adjusted based on this attribute; managed using bitwise operations. |
| `dpName` | `Record<string, string>` | `3.3.0` | dpName Custom DP name, typically used in the panel |
| `ability` | `number` | `3.3.0` | ability Rarely used; distinguishes special device types |
| `icon` | `string` | `3.3.0` | icon Device icon URL |
| `devId` | `string` | `3.3.0` | devId The device's unique ID |
| `verSw` | `string` | `3.3.0` | verSw Firmware version |
| `isShare` | `boolean` | `3.3.0` | isShare Whether the device is shared; true indicates a shared device |
| `bv` | `string` | `3.3.0` | bv Baseline version |
| `uuid` | `string` | `3.3.0` | uuid Unique firmware identifier |
| `panelConfig` | `Record<string, Record<string, any>>` | `3.3.0` | panelConfig Configuration items in the product panel; corresponding settings are usually visible on the IoT platform |
| `activeTime` | `number` | `3.3.0` | activeTime Device activation time (timestamp) |
| `devAttribute` | `number` | `3.3.0` | devAttribute Extended business capability flags, using bitwise operations |
| `pcc` | `string` | `3.3.0` | pcc Classification identifier for Thing in-house Bluetooth mesh products |
| `nodeId` | `string` | `3.3.0` | nodeId Short address of the sub-device |
| `parentId` | `string` | `3.3.0` | parentId Parent node ID; typically present on sub-devices or Bluetooth Mesh devices; used internally to locate the related gateway or parent model for business processing |
| `category` | `string` | `3.3.0` | category Product category |
| `standSchemaModel` | `Record<string, any>` | `3.3.0` | standSchemaModel Standard product function set definition model |
| `productId` | `string` | `3.3.0` | productId Product ID for the device |
| `productVer` | `string` | `4.3.6` | productVer Product version for the device |
| `bizAttribute` | `number` | `3.3.0` | bizAttribute Business attribute capabilities |
| `meshId` | `string` | `3.3.0` | meshId Bluetooth Mesh ID for the device |
| `sigmeshId` | `string` | `3.3.0` | [Deprecated] sigmeshId Bluetooth Mesh ID corresponding to the device's industry attribute |
| `meta` | `Record<string, Record<string, any>>` | `3.3.0` | meta Custom configuration meta-attributes for the device, used to store business data |
| `isLocalOnline` | `boolean` | `3.3.0` | isLocalOnline Whether the device is online on the local LAN |
| `isCloudOnline` | `boolean` | `3.3.0` | Device cloud online status |
| `isOnline` | `boolean` | `3.3.0` | isOnline Overall online status; if any status is online, it's considered online (composite status) |
| `name` | `string` | `3.3.0` | name Device name |
| `groupId` | `string` | `3.3.0` | groupId Group ID the device belongs to; empty string when not in a group |
| `dpCodes` | `Record<string, Record<string, any>>` | `3.3.0` | dpCodes Standard function set code |
| `devTimezoneId` | `string` | `3.3.0` | Timezone information |
| `dpsTime` | `Record<string, Record<string, any>>` | `3.3.0` | Execution time of the device's DP |
| `latitude` | `string` | `3.3.0` | Device latitude |
| `longitude` | `string` | `3.3.0` | Device longitude |
| `ip` | `string` | `3.3.0` | Device IP address |
| `isVirtualDevice` | `boolean` | `3.3.0` | Whether it is a virtual device |
| `isZigbeeInstallCode` | `boolean` | `3.3.0` | Whether this is a Zigbee Install Code gateway |
| `protocolAttribute` | `number` | `3.3.0` | Sub-device activation capability flag bit |
| `connectionStatus` | `number` | `3.3.0` | Connection status; nearby status |
| `mac` | `string` | `3.3.0` | Some devices require a MAC address for unique identification, e.g., mesh |
| `bluetoothCapability` | `string` | `3.3.0` | Bluetooth device capability value, reported by the device |
| `isTripartiteMatter` | `boolean` | `3.6.0` | Whether it is a third-party Matter device |
| `isGW` | `boolean` | `3.6.0` | Whether it is a gateway device |
| `isSupportGroup` | `boolean` | `3.6.0` | Whether groups are supported |
| `isZigBeeSubDev` | `boolean` | `3.6.0` | Whether it is a Zigbee sub-device |
| `cadv` | `string` | `3.6.0` | cadv version number |
| `isSupportOTA` | `boolean` | `3.6.0` | Whether the device supports OTA |
| `iconUrl` | `string` | `3.6.0` | Device icon |
| `hasWifi` | `boolean` | `3.6.0` | Whether the device has a Wi‑Fi module |
| `switchDp` | `number` | `3.7.0` | Quick control DP |
| `switchDps` | `number[]` | `3.7.0` | Quick control DP |
| `wifiEnableState` | `number` | `4.0.0` | Status of the device's Wi‑Fi module: 1: unavailable, 2: available |
| `configMetas` | `Record<string, Record<string, any>>` | `4.0.0` | Device product configuration |
| `isMatter` | `boolean` | `4.0.0` | Whether it is a Matter device |
| `isSupportLink` | `boolean` | `4.0.0` | Whether the device supports dual-control |
| `isSupportAppleHomeKit` | `boolean` | `4.0.0` | Whether the device can be added to Apple Home |
| `attributeString` | `string` | `4.0.0` | attribute formatted binary string Product attribute definition. The corresponding configuration can be found on the backend-ng platform; managed via bitwise operations. |
| `extModuleType` | `number` | `4.3.4` | Type of the device’s expansion module 0: No expansion module 1: Expansion module present, i.e., the device is BLE+X 2: The expansion module is a Wi-Fi module, i.e., the device is BLE+Wi-Fi |
| `isRelayOpen` | `boolean` | `4.6.1` | Whether relay is enabled on the mesh device |
| `isProxyOpen` | `boolean` | `4.6.1` | Whether proxy is enabled on the mesh device |
| `isSupportProxyAndRelay` | `boolean` | `4.6.1` | Whether the mesh device supports proxy and relay |
| `yuNetState` | `number` | `4.11.0` | User enable status of the device’s Dayu channel: 0 - disabled, 1 - enabled |


### Examples

#### Basic usage

```tsx
import { device } from '@ray-js/ray'

const { getSubDeviceInfoList } = device;

getSubDeviceInfoList({
  meshId: 'example',
  success: (result) => {
    console.log('getSubDeviceInfoList success', result);
  },
  fail: (error) => {
    console.log('getSubDeviceInfoList fail', error.errorMsg);
  },
});
```
