Callback function pointer types of the MQTT Agent.
More...
Callback function pointer types of the MQTT Agent.
◆ MQTTAgentCommandCallback_t
Callback function called when a command completes.
- Parameters
-
[in] | pCmdCallbackContext | The callback context passed to the original command. |
[in] | pReturnInfo | A struct of status codes and outputs from the command. |
- Note
- A command should not be considered complete until this callback is called, and the arguments that the command uses MUST stay in scope until such happens.
-
The callback MUST NOT block as it runs in the context of the MQTT agent task. If the callback calls any MQTT Agent API to enqueue a command, the blocking time (blockTimeMs member of MQTTAgentCommandInfo_t) MUST be zero. If the application wants to enqueue command(s) with non-zero blocking time, the callback can notify a different task to enqueue command(s) to the MQTT agent.
◆ MQTTAgentIncomingPublishCallback_t
typedef void(* MQTTAgentIncomingPublishCallback_t) (struct MQTTAgentContext *pMqttAgentContext, uint16_t packetId, MQTTPublishInfo_t *pPublishInfo) |
Callback function called when receiving a publish.
- Parameters
-
[in] | pMqttAgentContext | The context of the MQTT agent. |
[in] | packetId | The packet ID of the received publish. |
[in] | pPublishInfo | Deserialized publish information. |
- Note
- The callback MUST NOT block as it runs in the context of the MQTT agent task. If the callback calls any MQTT Agent API to enqueue a command, the blocking time (blockTimeMs member of MQTTAgentCommandInfo_t) MUST be zero. If the application wants to enqueue command(s) with non-zero blocking time, the callback can notify a different task to enqueue command(s) to the MQTT agent.