Updated on 2025-12-04 GMT+08:00

Functions

The SDK is designed for embedded devices with powerful computing and storage capabilities. You can call SDK APIs to implement communication between devices and the platform. The table below lists the functions supported by the SDK.

Table 1 Functions supported by OpenHarmony ArkTS

Function

Description

Device initialization

Served as a client for connecting devices to the Huawei Cloud platform using MQTT. Currently, only secret authentication is supported.

Custom options

Used for custom configuration of reconnection and connection status listeners.

Reconnection upon disconnection

Used to reconnect a device disconnected due to a connection failure or network instability.

Message reporting and delivery

Used to report custom data from devices to the platform, which then forwards the reported data to applications or other Huawei Cloud services for storage and processing. Used to deliver messages from the platform to devices, which then process the received messages.

Property reporting, setting, and query

Used by a device to report property data in the format defined in the product model to the platform, or used to set device properties on the platform. After receiving a property setting request, the device returns the result to the platform. Used to query device properties on the platform. After receiving a property query request, the device returns the property data to the platform.

Command delivery

Used by the platform to deliver a command to a device. After the platform delivers a command, the device needs to return the command execution result to the platform in a timely manner.

Device shadow obtaining

Used by a device to obtain device shadow data from the platform.

Model-oriented Programming

Used for product model–oriented programming. This approach leverages the object model abstraction feature of the SDK. By defining device services within the device code according to the product model, the SDK can seamlessly interact with the platform to synchronize properties and execute commands.

Product model-oriented programming streamlines device code by allowing a focus solely on defining services, rather than managing communication processes. This approach offers a simpler alternative to using client APIs.