coreMQTT Agent v1.1.0
Thread safe MQTT 3.1.1 Client
Callback Types

Callback function pointer types of the MQTT Agent. More...

Typedefs

typedef void(* MQTTAgentCommandCallback_t) (MQTTAgentCommandContext_t *pCmdCallbackContext, MQTTAgentReturnInfo_t *pReturnInfo)
 Callback function called when a command completes. More...
 
typedef void(* MQTTAgentIncomingPublishCallback_t) (struct MQTTAgentContext *pMqttAgentContext, uint16_t packetId, MQTTPublishInfo_t *pPublishInfo)
 Callback function called when receiving a publish. More...
 

Detailed Description

Callback function pointer types of the MQTT Agent.

Typedef Documentation

◆ MQTTAgentCommandCallback_t

typedef void(* MQTTAgentCommandCallback_t) (MQTTAgentCommandContext_t *pCmdCallbackContext, MQTTAgentReturnInfo_t *pReturnInfo)

Callback function called when a command completes.

Parameters
[in]pCmdCallbackContextThe callback context passed to the original command.
[in]pReturnInfoA 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]pMqttAgentContextThe context of the MQTT agent.
[in]packetIdThe packet ID of the received publish.
[in]pPublishInfoDeserialized 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.