FreeRTOS / coreMQTT-Agent

Implements an MQTT agent (or daemon) task for simple MQTT connection sharing among different threads of execution.
MIT License
29 stars 32 forks source link

Update Agent to treat MQTTNeedMoreBytes correctly #103

Closed AniruddhaKanhere closed 1 year ago

AniruddhaKanhere commented 1 year ago

Description

Currently, the Agent drops the connection in case a partial packet is received. Which is not correct given that coreMQTT can handle partial packets correctly.

This PR fixes that by resetting the return value of the processCommand function when coreMQTT returns MQTTNeedMoreBytes.

Test Steps

Make sure that the server sends partial MQTT packets to the client. Without these changes, the library will terminate the connection. With this change in place the library will not drop the connection and work correctly.

Checklist:

Related Issue

https://github.com/FreeRTOS/coreMQTT-Agent/issues/102

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.