Cancel all command when MQTT command failed (#814)

* Use MQTT Agent provided API, MQTTAgent_CancelAll, to clear queue when
  MQTT command failed.
pull/816/head
chinglee-iot 3 years ago committed by GitHub
parent ad88de61d0
commit 5a2c56bf9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2132,7 +2132,7 @@ static void prvMQTTAgentTask(void* pParam)
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
/* Clear Agent queue so that no any pending MQTT operations are processed. */
xQueueReset(xCommandQueue.queue);
MQTTAgent_CancelAll(&xGlobalMqttAgentContext);
/* Success is returned for application initiated disconnect or termination. The socket will also be disconnected by the caller. */
if (xMQTTStatus != MQTTSuccess)

@ -1725,7 +1725,7 @@ static void prvMQTTAgentTask(void* pParam)
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
/* Clear Agent queue so that no any pending MQTT operations are processed. */
xQueueReset(xCommandQueue.queue);
MQTTAgent_CancelAll(&xGlobalMqttAgentContext);
/* Success is returned for application initiated disconnect or termination. The socket will also be disconnected by the caller. */
if (xMQTTStatus != MQTTSuccess)

Loading…
Cancel
Save