Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT - handling re-sends when a session is reestablished. #980

Closed
wants to merge 5 commits into from
Closed
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
7 changes: 7 additions & 0 deletions libraries/standard/mqtt/include/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
#include "mqtt_config.h"
#include "mqtt_lightweight.h"

/**
* @brief Invalid packet identifier.
*
* Zero is an invalid packet identifier as per MQTT v3.1.1 spec.
*/
#define MQTT_PACKET_ID_INVALID ( ( uint16_t ) 0U )

struct MQTTApplicationCallbacks;
typedef struct MQTTApplicationCallbacks MQTTApplicationCallbacks_t;

Expand Down
16 changes: 16 additions & 0 deletions libraries/standard/mqtt/include/mqtt_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,20 @@ uint16_t MQTT_StateSelect( const MQTTContext_t * pMqttContext,
MQTTPublishState_t searchState,
MQTTStateCursor_t * pCursor );

/**
* @brief Get the publish state for the publish packet with the given packet id.
*
* @param[in] pMqttContext Initialized MQTT context.
* @param[in] packetId The packet id of the packet to search for.
* @param[in] incomingPublish Whether to search for the publish packet in
* incoming publish records or the outgoing publish records. True for searching
* in incoming publish record; false for searching outgoing publish record.
*
* @return #MQTTStateNull if no publish packet found or if invalid parameters
* are passed; state of the publish packet with given packet id otherwise.
*/
MQTTPublishState_t MQTT_GetPacketState( const MQTTContext_t * pMqttContext,
uint16_t packetId,
bool incomingPublish );

#endif /* ifndef MQTT_STATE_H */
Loading