Updated on 2022-06-30 GMT+08:00

Mechanism

A product model defines commands that can be delivered to the devices. Applications can call platform APIs to deliver commands to the devices to effectively manage these devices.

The IoT platform supports synchronous and asynchronous command delivery.

Mechanism

Description

Application Scenario

Devices Using LwM2M over CoAP

Devices Using MQTT

Synchronous command delivery

An application calls the synchronous command delivery API to deliver a command to a specified device for device control. The platform sends the command to the device and returns the command execution result in an HTTP request to the application. If the device does not respond, the platform returns a timeout message to the application.

Applicable to commands that must be executed in real time, for example, turning on a street lamp or closing a gas meter switch. Applications should determine the appropriate time to deliver a command.

Not applicable

Applicable

Asynchronous command delivery

An application calls the asynchronous command delivery API to deliver a command to a specified device for device control. The platform sends the command to the device and asynchronously pushes the command execution result to the application.

Asynchronous command delivery is classified into immediate delivery and delayed delivery.

  • In immediate delivery, the platform delivers commands to a device regardless of whether the device is online. If the device is offline or the device does not receive the command, the delivery fails.
  • In delayed delivery, the platform caches a command and delivers it to a device when the device goes online or reports data. If a device has multiple pending commands, the platform delivers the commands in sequence.
  • Immediate delivery applies to scenarios with high real-time requirements.
  • Delayed delivery applies to commands that do not need to be executed immediately, for example, configuring water meter parameters.

Applicable

Not applicable