mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-01-22 01:30:31 -05:00
Cancel all command when MQTT command failed (#814)
* Use MQTT Agent provided API, MQTTAgent_CancelAll, to clear queue when MQTT command failed.
This commit is contained in:
parent
ad88de61d0
commit
5a2c56bf9c
2 changed files with 2 additions and 2 deletions
|
|
@ -2132,7 +2132,7 @@ static void prvMQTTAgentTask(void* pParam)
|
||||||
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
|
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
|
||||||
|
|
||||||
/* Clear Agent queue so that no any pending MQTT operations are processed. */
|
/* 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. */
|
/* Success is returned for application initiated disconnect or termination. The socket will also be disconnected by the caller. */
|
||||||
if (xMQTTStatus != MQTTSuccess)
|
if (xMQTTStatus != MQTTSuccess)
|
||||||
|
|
|
||||||
|
|
@ -1725,7 +1725,7 @@ static void prvMQTTAgentTask(void* pParam)
|
||||||
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
|
xMQTTStatus = MQTTAgent_CommandLoop(&xGlobalMqttAgentContext);
|
||||||
|
|
||||||
/* Clear Agent queue so that no any pending MQTT operations are processed. */
|
/* 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. */
|
/* Success is returned for application initiated disconnect or termination. The socket will also be disconnected by the caller. */
|
||||||
if (xMQTTStatus != MQTTSuccess)
|
if (xMQTTStatus != MQTTSuccess)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue