Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions source/core_mqtt_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,18 +973,6 @@ MQTTStatus_t MQTTAgent_Init( MQTTAgentContext_t * pMqttAgentContext,
{
MQTTStatus_t returnStatus;

/**
* @brief Array used to maintain the outgoing publish records and their
* state by the coreMQTT library.
*/
static MQTTPubAckInfo_t pIncomingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ];

/**
* @brief Array used to maintain the outgoing publish records and their
* state by the coreMQTT library.
*/
static MQTTPubAckInfo_t pOutgoingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ];

if( ( pMqttAgentContext == NULL ) ||
( pMsgInterface == NULL ) ||
( pTransportInterface == NULL ) ||
Expand Down Expand Up @@ -1017,9 +1005,9 @@ MQTTStatus_t MQTTAgent_Init( MQTTAgentContext_t * pMqttAgentContext,
if( returnStatus == MQTTSuccess )
{
returnStatus = MQTT_InitStatefulQoS( &( pMqttAgentContext->mqttContext ),
pOutgoingPublishRecords,
pMqttAgentContext->pOutgoingPublishRecords,
MQTT_AGENT_MAX_OUTSTANDING_ACKS,
pIncomingPublishRecords,
pMqttAgentContext->pIncomingPublishRecords,
MQTT_AGENT_MAX_OUTSTANDING_ACKS );
}
}
Expand Down
14 changes: 8 additions & 6 deletions source/include/core_mqtt_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ typedef void (* MQTTAgentIncomingPublishCallback_t )( struct MQTTAgentContext *
*/
typedef struct MQTTAgentContext
{
MQTTContext_t mqttContext; /**< MQTT connection information used by coreMQTT. */
MQTTAgentMessageInterface_t agentInterface; /**< Struct of function pointers for agent messaging. */
MQTTAgentAckInfo_t pPendingAcks[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; /**< List of pending acknowledgment packets. */
MQTTAgentIncomingPublishCallback_t pIncomingCallback; /**< Callback to invoke for incoming publishes. */
void * pIncomingCallbackContext; /**< Context for incoming publish callback. */
bool packetReceivedInLoop; /**< Whether a MQTT_ProcessLoop() call received a packet. */
MQTTContext_t mqttContext; /**< MQTT connection information used by coreMQTT. */
MQTTAgentMessageInterface_t agentInterface; /**< Struct of function pointers for agent messaging. */
MQTTAgentAckInfo_t pPendingAcks[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; /**< List of pending acknowledgment packets. */
MQTTAgentIncomingPublishCallback_t pIncomingCallback; /**< Callback to invoke for incoming publishes. */
void * pIncomingCallbackContext; /**< Context for incoming publish callback. */
bool packetReceivedInLoop; /**< Whether a MQTT_ProcessLoop() call received a packet. */
MQTTPubAckInfo_t pIncomingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; /**< Array used to maintain the incoming publish records and their state by the coreMQTT library. */
MQTTPubAckInfo_t pOutgoingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; /**< Array used to maintain the outgoing publish records and their state by the coreMQTT library. */
} MQTTAgentContext_t;

/**
Expand Down