Resume a session by resending publishes if a session is present in the broker, or clear state information if not.
- Parameters
-
| [in] | pMqttAgentContext | The MQTT agent to use. |
| [in] | sessionPresent | The session present flag from the broker. |
- Note
- This function is NOT thread-safe and should only be called from the context of the task responsible for MQTTAgent_CommandLoop.
- Returns
- #MQTTSuccess if it succeeds in resending publishes, else an appropriate error code from MQTT_Publish()
Example
MQTTStatus_t status;
MQTTConnectInfo_t connectInfo = { 0 };
MQTTPublishInfo_t willInfo = { 0 };
bool sessionPresent;
status = MQTT_Connect( &( mqttAgentContext.
mqttContext ), &connectInfo, &willInfo, 100, &sessionPresent )
if( status == MQTTSuccess )
{
}
MQTTStatus_t MQTTAgent_ResumeSession(MQTTAgentContext_t *pMqttAgentContext, bool sessionPresent)
Resume a session by resending publishes if a session is present in the broker, or clear state informa...
Definition core_mqtt_agent.c:1076
Information used by each MQTT agent. A context will be initialized by MQTTAgent_Init(),...
Definition core_mqtt_agent.h:153
MQTTContext_t mqttContext
Definition core_mqtt_agent.h:154