core_mqtt.h and other coreMQTT headers pull in core_mqtt_config.h and core_mqtt_config_defaults.h.
core_mqtt_config_defaults.h defines empty logging macros. This means every application that uses coreMQTT needs to be careful to set up the logging stack before including core_mqtt.h or they may mysteriously not have logging output.
The logging setup should be in each compilation object, not set up in headers. This moves the inclusion of default logging macros from the headers to the library c files.
This fixes the issue with the logging macros for customers who do not set the logging macros in their core_mqtt_config.h. However, those who do enable logging for coreMQTT will still have their coreMQTT logging setup in all their c files using coreMQTT.
* Change logging level on CONNACK from 'Info' to 'Debug' to reflect CONNECT
* Changed Debug logging to Error logging where MQTTBadResponse is set
* Fix formatting
* Update source/core_mqtt_serializer.c
Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>
* Change LogInfo to LogDebug on line 958 to mirror line 970
* Fix comments with inconsistent byte indexes
Co-authored-by: Hendrickson <johnrhen@88665a3d649f.ant.amazon.com>
Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>
* Update version numbers
* Update CHANGELOG.md
* Add guards for C++ linkage
* Link to Memory estimates markdown from README
* Make possible to override CMake C Standard for tests
The debug-level log that is printed on not receiving any data from the network (when the first byte of an MQTT packet is attempted for reading) can be problematic when the transport interface TransportInterfaceRecv_t function is implemented in non-blocking behavior.
The problem it will cause is overwhelming logging of the message when MQTT_ProcessLoop API is called with a non-zero timeout (or the API is called multiple times with zero timeout but within a loop until some data is achieved). Due to over-logging of this message, the DEBUG logging level configured build of the coreMQTT library will be non-valuable.
This PR removes the problematic log statement.
This follows changes from FreeRTOS/FreeRTOS@398abba. The const qualifier is removed from send/recv because there are transport implementations that require a member of the network context to be modified such as in the case of mbedtls.
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.
* Set publish payload to NULL when zero length
* Add unit test for zero length payload
* Fix unit tests for deserialize publish
* Rename setupWillInfo to setupPublishInfo
* Remove void * from memset
* 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>