---
name: "getMeshDeviceId"
mode: "kit"
versionRequirements:
  - { name: "DeviceKit", version: "2.4.0" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getMeshDeviceId

> [VERSION] DeviceKit >= 2.4.0

> [PLATFORM] iOS, Android

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

### Description

Get the sub-device device ID by nodeId. On success, the success callback returns DeviceResult containing the sub-device deviceId

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `nodeId` | `string` | Yes | - | `2.4.0` | Mesh sub-device nodeId (getMeshDeviceId uses the normal format; getMeshDeviceIdHex uses Hex format) |
| `deviceId` | `string` | Yes | - | `2.4.0` | deviceId Gateway ID |
| `complete` | `() => void` | No | - | - | Callback invoked when the call completes (runs on success or failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | - | Success callback |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `deviceId` | `string` | `3.3.0` | Queried Mesh sub-device deviceId |

#### 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` | Extended error code |
| `errorMsg` | `string` | Extended error info |
