27#ifndef CORE_MQTT_AGENT_COMMAND_FUNCTIONS_H
28#define CORE_MQTT_AGENT_COMMAND_FUNCTIONS_H
58#ifndef MQTT_AGENT_FUNCTION_TABLE
60 #if defined( __STDC_VERSION__ ) && ( __STDC_VERSION__ >= 199901L )
61 #define MQTT_AGENT_FUNCTION_TABLE \
63 [ NONE ] = MQTTAgentCommand_ProcessLoop, \
64 [ PROCESSLOOP ] = MQTTAgentCommand_ProcessLoop, \
65 [ PUBLISH ] = MQTTAgentCommand_Publish, \
66 [ SUBSCRIBE ] = MQTTAgentCommand_Subscribe, \
67 [ UNSUBSCRIBE ] = MQTTAgentCommand_Unsubscribe, \
68 [ PING ] = MQTTAgentCommand_Ping, \
69 [ CONNECT ] = MQTTAgentCommand_Connect, \
70 [ DISCONNECT ] = MQTTAgentCommand_Disconnect, \
71 [ TERMINATE ] = MQTTAgentCommand_Terminate \
77 #define MQTT_AGENT_FUNCTION_TABLE \
79 MQTTAgentCommand_ProcessLoop, \
80 MQTTAgentCommand_ProcessLoop, \
81 MQTTAgentCommand_Publish, \
82 MQTTAgentCommand_Subscribe, \
83 MQTTAgentCommand_Unsubscribe, \
84 MQTTAgentCommand_Ping, \
85 MQTTAgentCommand_Connect, \
86 MQTTAgentCommand_Disconnect, \
87 MQTTAgentCommand_Terminate \
99typedef struct MQTTAgentCommandFuncReturns
173 void * pVoidSubscribeArgs,
190 void * pVoidSubscribeArgs,
205 void * pVoidConnectArgs,
Functions for running a coreMQTT client in a dedicated thread.
MQTTStatus_t MQTTAgentCommand_Publish(MQTTAgentContext_t *pMqttAgentContext, void *pPublishArg, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a PUBLISH command.
Definition: core_mqtt_agent_command_functions.c:57
MQTTStatus_t MQTTAgentCommand_Ping(MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a PING command.
Definition: core_mqtt_agent_command_functions.c:199
MQTTStatus_t MQTTAgentCommand_Terminate(MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a TERMINATE command. Calls MQTTAgent_CancelAll to terminate all unfinished co...
Definition: core_mqtt_agent_command_functions.c:221
MQTTStatus_t MQTTAgentCommand_Disconnect(MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a DISCONNECT command.
Definition: core_mqtt_agent_command_functions.c:178
MQTTStatus_t MQTTAgentCommand_Connect(MQTTAgentContext_t *pMqttAgentContext, void *pVoidConnectArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a CONNECT command.
Definition: core_mqtt_agent_command_functions.c:144
MQTTStatus_t MQTTAgentCommand_Subscribe(MQTTAgentContext_t *pMqttAgentContext, void *pVoidSubscribeArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a SUBSCRIBE command.
Definition: core_mqtt_agent_command_functions.c:88
MQTTStatus_t MQTTAgentCommand_ProcessLoop(MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for a NONE command. This function does not call MQTT_ProcessLoop itself,...
Definition: core_mqtt_agent_command_functions.c:41
MQTTStatus_t MQTTAgentCommand_Unsubscribe(MQTTAgentContext_t *pMqttAgentContext, void *pVoidSubscribeArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags)
Function to execute for an UNSUBSCRIBE command.
Definition: core_mqtt_agent_command_functions.c:116
MQTTStatus_t(* MQTTAgentCommandFunc_t)(MQTTAgentContext_t *pMqttAgentContext, void *pArgs, MQTTAgentCommandFuncReturns_t *pFlags)
Function prototype for a command.
Definition: core_mqtt_agent_command_functions.h:119
A structure of values and flags expected to be returned by command functions.
Definition: core_mqtt_agent_command_functions.h:100
bool addAcknowledgment
Flag to indicate an acknowledgment should be tracked.
Definition: core_mqtt_agent_command_functions.h:103
bool runProcessLoop
Flag to indicate MQTT_ProcessLoop() should be called after this command.
Definition: core_mqtt_agent_command_functions.h:104
uint16_t packetId
Packet ID of packet sent by command.
Definition: core_mqtt_agent_command_functions.h:101
bool endLoop
Flag to indicate command loop should terminate.
Definition: core_mqtt_agent_command_functions.h:102
Information used by each MQTT agent. A context will be initialized by MQTTAgent_Init(),...
Definition: core_mqtt_agent.h:179