Functions for processing an MQTT agent command. More...
#include "core_mqtt_agent.h"
Go to the source code of this file.
Data Structures | |
struct | MQTTAgentCommandFuncReturns_t |
A structure of values and flags expected to be returned by command functions. More... | |
Macros | |
#define | MQTT_AGENT_FUNCTION_TABLE |
An array of function pointers mapping command types to a function to execute. Configurable to allow a linker to remove unneeded functions. More... | |
Typedefs | |
typedef MQTTStatus_t(* | MQTTAgentCommandFunc_t) (MQTTAgentContext_t *pMqttAgentContext, void *pArgs, MQTTAgentCommandFuncReturns_t *pFlags) |
Function prototype for a command. More... | |
Functions | |
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, but instead sets a flag to indicate it should be called. More... | |
MQTTStatus_t | MQTTAgentCommand_Publish (MQTTAgentContext_t *pMqttAgentContext, void *pPublishArg, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for a PUBLISH command. More... | |
MQTTStatus_t | MQTTAgentCommand_Subscribe (MQTTAgentContext_t *pMqttAgentContext, void *pVoidSubscribeArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for a SUBSCRIBE command. More... | |
MQTTStatus_t | MQTTAgentCommand_Unsubscribe (MQTTAgentContext_t *pMqttAgentContext, void *pVoidSubscribeArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for an UNSUBSCRIBE command. More... | |
MQTTStatus_t | MQTTAgentCommand_Connect (MQTTAgentContext_t *pMqttAgentContext, void *pVoidConnectArgs, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for a CONNECT command. More... | |
MQTTStatus_t | MQTTAgentCommand_Disconnect (MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for a DISCONNECT command. More... | |
MQTTStatus_t | MQTTAgentCommand_Ping (MQTTAgentContext_t *pMqttAgentContext, void *pUnusedArg, MQTTAgentCommandFuncReturns_t *pReturnFlags) |
Function to execute for a PING command. More... | |
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 commands with MQTTRecvFailed. More... | |
Functions for processing an MQTT agent command.
#define MQTT_AGENT_FUNCTION_TABLE |
An array of function pointers mapping command types to a function to execute. Configurable to allow a linker to remove unneeded functions.
Default value:
typedef MQTTStatus_t(* MQTTAgentCommandFunc_t) (MQTTAgentContext_t *pMqttAgentContext, void *pArgs, MQTTAgentCommandFuncReturns_t *pFlags) |
Function prototype for a command.
[in] | pMqttAgentContext | MQTT Agent context. |
[in] | pArgs | Arguments for the command. |
[out] | pFlags | Return flags set by the function. |
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, but instead sets a flag to indicate it should be called.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pUnusedArg | Unused NULL argument. |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Publish | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pPublishArg, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for a PUBLISH command.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pPublishArg | Publish information for MQTT_Publish(). |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Subscribe | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pVoidSubscribeArgs, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for a SUBSCRIBE command.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pVoidSubscribeArgs | Arguments for MQTT_Subscribe(). |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Unsubscribe | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pVoidSubscribeArgs, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for an UNSUBSCRIBE command.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pVoidSubscribeArgs | Arguments for MQTT_Unsubscribe(). |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Connect | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pVoidConnectArgs, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for a CONNECT command.
This sets all return flags to false
.
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pVoidConnectArgs | Arguments for MQTT_Connect(). |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Disconnect | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pUnusedArg, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for a DISCONNECT command.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pUnusedArg | Unused NULL argument. |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
MQTTStatus_t MQTTAgentCommand_Ping | ( | MQTTAgentContext_t * | pMqttAgentContext, |
void * | pUnusedArg, | ||
MQTTAgentCommandFuncReturns_t * | pReturnFlags | ||
) |
Function to execute for a PING command.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pUnusedArg | Unused NULL argument. |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |
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 commands with MQTTRecvFailed.
This sets the following flags to true
:
[in] | pMqttAgentContext | MQTT Agent context information. |
[in] | pUnusedArg | Unused NULL argument. |
[out] | pReturnFlags | Flags set to indicate actions the MQTT agent should take. |