1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-05-17 15:52:22 +08:00

11 Commits

Author SHA1 Message Date
Oscar Michael Abrina
4f7d1b9f9e
Enable debug logging in unit-test build and fix logging compilation error (#125)
- Update core_mqtt_config.h to specify logging level as LOG_NONE
- Update GA to set logging level as LOG_DEBUG
- Fix compile error in LogDebug of recvExact
2020-12-06 18:09:58 -08:00
Archit Aggarwal
b581fc4172
Bugfix: Fix interrupted network read operation (#120)
### Problem

The `MQTT_ProcessLoop` and `MQTT_ReceiveLoop` read incoming MQTT packet payload over the network by calling the `recvExact` function. The `recvExact` function can be called multiple times to read the expected number of bytes for the MQTT packet but it also implements a timeout functionality of receiving the expected number of payload within the timeout value passed to the function.
This causes problems when the `Transport_Recv` call returns less than requested number of bytes, and there is a timeout (for example, when calling `MQTT_ProcessLoop` with 0ms duration) which causes the function to assume failure instead of reading the remaining payload of the MQTT packet by calling `Transport_Recv` again. Thus, in such cases, the MQTT connection is severed prematurely even though there is a high probability of receiving the remaining bytes of the MQTT packet over the network.

### Solution
Instead of implementing a timeout on the entire duration of receiving the expected number of remaining MQTT packet bytes in `recvExact`, the use of timeout is being changed to be relevant only on the total time of receiving 0 bytes over the network over multiple calls to `Transport_Recv`.
As this modified meaning of the timeout duration is now unrelated to the timeout duration that the `MQTT_ProcessLoop` or `MQTT_ReceiveLoop` functions are called, a new configuration constant for the `recvExact` timeout value, `MQTT_RECV_POLLING_TIMEOUT_MS`, has been added to the library which will carry a default value of 10ms. 

Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-04 19:49:40 -08:00
Oscar Michael Abrina
de4edcd578
Cast variable type based on format identifier (#113)
Update logs to only ever use base format specifiers and cast to the standard C type to minimize compilation warnings.
2020-11-24 14:34:28 -08:00
SarenaAWS
66a35e4213
Update version v1.0.0 to v1.0.1. (#97) 2020-11-02 12:11:10 -08:00
Oscar Michael Abrina
c0fadc4339
Resend PUBACK and PUBREC irrespective of the DUP flag (#83)
This updates the coreMQTT library so as to resend a PUBACK and PUBREC for an incoming duplicate publish packet, irrespective of the broker setting the DUP flag.
2020-10-07 13:47:33 -07:00
Archit Aggarwal
227c31e53e
Update versioning case (#66) 2020-09-16 11:36:03 -07:00
Oscar Michael Abrina
0e1f5fb728
Add version number and missing @file tags (#53)
* Add version numbers

* Add missing @file tags

* Update lexicon.txt

* Update @brief tag for MQTT cbmc state

Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
2020-09-14 16:54:24 -07:00
Muneeb Ahmed
e914df6d22
Fix MISRA 10.3 violation (#31)
* Change a UL to a U for a uint32_t
2020-09-03 11:26:14 -07:00
Muneeb Ahmed
f0a8b3c1b3
Fix doxygen build due to renamed files (#20)
* Fix doxygen build due to renamed files

* ci: combine doxygen stderr into stdout
2020-09-01 12:25:24 -07:00
Muneeb Ahmed
b6bf2005ca
Fix bug that may sometimes disable keep alive (#7)
* Reset the waitingForPingResp flag in every MQTT_Connect
2020-08-31 12:45:46 -07:00
Archit Aggarwal
e83fadcfc7
Rename MQTT files, and Relocate CBMC and unit-test files (#12)
* Relocate CBMC to test/cbmc and unit test files to test/unit-test

* Rename all library and test files to use "core_" prefix
2020-08-31 10:02:38 -07:00