coreMQTT Agent v1.1.0
Thread safe MQTT 3.1.1 Client
core_mqtt_agent_command_functions.c File Reference

Implements functions to process MQTT agent commands. More...

#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "core_mqtt_agent.h"
#include "core_mqtt_agent_command_functions.h"

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...
 

Detailed Description

Implements functions to process MQTT agent commands.

Function Documentation

◆ MQTTAgentCommand_ProcessLoop()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pUnusedArgUnused NULL argument.
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
MQTTSuccess.

◆ MQTTAgentCommand_Publish()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pPublishArgPublish information for MQTT_Publish().
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Publish().

◆ MQTTAgentCommand_Subscribe()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pVoidSubscribeArgsArguments for MQTT_Subscribe().
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Subscribe().

◆ MQTTAgentCommand_Unsubscribe()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pVoidSubscribeArgsArguments for MQTT_Unsubscribe().
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Unsubscribe().

◆ MQTTAgentCommand_Connect()

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.

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pVoidConnectArgsArguments for MQTT_Connect().
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Connect().

◆ MQTTAgentCommand_Disconnect()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pUnusedArgUnused NULL argument.
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Disconnect().

◆ MQTTAgentCommand_Ping()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pUnusedArgUnused NULL argument.
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
Status code of MQTT_Ping().

◆ MQTTAgentCommand_Terminate()

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:

Parameters
[in]pMqttAgentContextMQTT Agent context information.
[in]pUnusedArgUnused NULL argument.
[out]pReturnFlagsFlags set to indicate actions the MQTT agent should take.
Returns
MQTTSuccess.