const MQTTFixedBuffer_t * pNetworkBuffer,
const TransportInterface_t * pTransportInterface,
MQTTGetCurrentTimeFunc_t getCurrentTimeMs,
void * pIncomingPacketContext,
uint8_t * pAckPropsBuffer,
size_t ackPropsBufferSize );
Perform any initialization the MQTT agent requires before it can be used. Must be called before any other function.
uint32_t getTimeStampMs();
uint16_t packetId,
MQTTPublishInfo_t * pPublishInfo );
int32_t networkSend( NetworkContext_t * pContext, const void * pBuffer, size_t bytes );
int32_t networkRecv( NetworkContext_t * pContext, void * pBuffer, size_t bytes );
MQTTAgentCommand_t * const * pCommandToSend,
uint32_t blockTimeMs );
MQTTAgentCommand_t ** pCommandToSend,
uint32_t blockTimeMs );
MQTTAgentCommand_t * getCommand( uint32_t blockTimeMs );
bool releaseCommand( MQTTAgentCommand_t * pCommandToRelease );
TransportInterface_t transport;
MQTTFixedBuffer_t fixedBuffer;
uint8_t buffer[ 1024 ];
MQTTStatus_t status;
transport.pNetworkContext = &someTransportContext;
transport.send = networkSend;
transport.recv = networkRecv;
messageInterface.
pMsgCtx = &messageContext;
messageInterface.
send = agentSendMessage;
messageInterface.
recv = agentReceiveMessage;
fixedBuffer.pBuffer = buffer;
fixedBuffer.size = 1024;
&messageInterface,
&networkBuffer,
&transportInterface,
stubGetTime,
stubPublishCallback,
incomingPacketContext );
if( status == MQTTSuccess )
{
}
MQTTStatus_t MQTTAgent_Init(MQTTAgentContext_t *pMqttAgentContext, const MQTTAgentMessageInterface_t *pMsgInterface, const MQTTFixedBuffer_t *pNetworkBuffer, const TransportInterface_t *pTransportInterface, MQTTGetCurrentTimeFunc_t getCurrentTimeMs, MQTTAgentIncomingPublishCallback_t incomingCallback, void *pIncomingPacketContext, uint8_t *pAckPropsBuffer, size_t ackPropsBufferSize)
Perform any initialization the MQTT agent requires before it can be used. Must be called before any o...
Definition core_mqtt_agent.c:967
struct MQTTAgentMessageContext MQTTAgentMessageContext_t
Context with which tasks may deliver messages to the agent.
Definition core_mqtt_agent_message_interface.h:54
Information used by each MQTT agent. A context will be initialized by MQTTAgent_Init(),...
Definition core_mqtt_agent.h:153
Function pointers and contexts used for sending and receiving commands, and allocating memory for the...
Definition core_mqtt_agent_message_interface.h:133
MQTTAgentMessageContext_t * pMsgCtx
Definition core_mqtt_agent_message_interface.h:134
MQTTAgentMessageRecv_t recv
Definition core_mqtt_agent_message_interface.h:136
MQTTAgentCommandGet_t getCommand
Definition core_mqtt_agent_message_interface.h:137
MQTTAgentMessageSend_t send
Definition core_mqtt_agent_message_interface.h:135
MQTTAgentCommandRelease_t releaseCommand
Definition core_mqtt_agent_message_interface.h:138