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

## publishCommands

> [VERSION] DeviceKit >= 2.1.0

> [PLATFORM] iOS, Android

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

### Description

Send standard dp

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `2.1.0` | Device ID |
| `dps` | `Record<string, Record<string, any>>` | Yes | - | `2.1.0` | dps |
| `mode` | `number` | Yes | - | `2.1.0` | Delivery channel type 0: LAN 1: Network 2: Auto |
| `pipelines` | `number[]` | Yes | - | `2.1.0` | Priority of delivery channels LAN       = 0, // LAN MQTT      = 1, // MQTT HTTP      = 2, // Http BLE       = 3, // Single Point Bluetooth SIGMesh   = 4, // Sig Mesh BLEMesh   = 5, // Thing Private Mesh BLEBeacon = 6, // Beacon |
| `options` | `Record<string, Record<string, any>>` | Yes | - | `2.1.0` | Reserved flag for delivery logic configuration; can be extended later, e.g., delivering sounds, follow-up actions after delivery, etc. |
| `complete` | `() => void` | No | - | - | Callback invoked when the API call completes (runs on both success and failure) |
| `success` | `(params: boolean) => void` | No | - | - | Callback invoked on API call success |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Callback invoked on API call failure |

#### 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 |
