Handling the resend and receive of duplicate packets when an MQTT session is reestablished.
These are the cases that is handled in this PR,
When a session is reestablished,
Outgoing publishes:
Resend PUBLISHes for which and ack is not received(PUBACK and PUBREC).
Resend PUBRELs for PUBLISHes for which PUBCOMP was not received.
Incoming publishes:
Handle duplicate QoS1 and QoS2 PUBLISHes
Handle duplicate PUBRELs.
This change also handles the message ordering requirement in MQTT3.1.1 spec while re sending publishes and PUBRELs.
* Complete transport utilities library
* Get a building integration test for PubSub with Qos 0
* Updates to CMake for building integration test target
* Working QoS1 test and new test for QoS0
* Fix flaky behavior of QoS1 test by increasing ProcessLoop timeout
* Minor changes for logging configuration in test and tls_utils files
* Updates to CMock tooling for building mqtt_system_utest target
* Add a test case for Pub/Sub with QoS2
* Changes from review comments
* Change Publish request to not set retain flag to prevent inter-test side-effects
* Doc hygiene changes from more review comments
* Doc fix in demos/transport/CMakeLists.txt
* Remaining hygiene changes from review comments
* Rename integration test file to mqtt_system_test.c
* Update filename for @file tags in transport_utils files
* Update header macros for transport header files
* Remove MQTT build dependency from transport_utils. Rename CMake variables from utest to stest for integration tests
* Add inclue path for logging headers to transport_utils
* Use spaces instead of tabs
* Fix MQTT MISRA violations
* Remove unnecessary const
* Remove unused function
* Fix string.h warning and add macro to disable logs
* Use ternary for MISRA 10.5
* Remove TODO from logging header
* Use #ifndef around logging macro definitions in config files to resolve macro re-definition warning in demo builds
* Complete changes to HTTP and MQTT demos for logging config
* Add comments for config file includes in MQTT and HTTP library files
* Minor doc update for logging configuration across all config files
* Refactor state engine
* Reduce complexity and add strerror for state engine
* Fix MQTT build warnings and add status strerror
* Fix publish unit test to not trigger assert
* Add setupSubscriptionInfo
* Add simple test for subscribe
* Add passing happy path test for MQTT_Subscribe
* Achieve full coverage for MQTT_Subscribe and MQTT_Unsubscribe and its private functions
* Add coverage for MQTT_Ping
* Update comments
* Move private method to top
* Use MQTT_GetUnsubscribePacketSize for Unsubscribe tests
* Make calls one line
* Fix test_MQTT_SerializeConnect_Invalid_Params by setting connectInfo
* Achieve full coverage on MQTT_SerializeDisconnect
* Add docs
* Remove accidental update of mqtt_utest.c
* Add setupNetworkBuffer
* Add checks for serialized buffer
* Remove redefinition of setupNetworkBuffer
* Remove accidental update of mqtt_utest.c
* Update case for consistency
* Remove warnings in mqtt_state_utest.c
* fix: MQTT library issues found during demo development.
1. Make serialize ping request behavior same as disconnect.
2. Remove unnecessary function call from serialize disconnect.
3. Fix serialize unsubscribe.
Below are the issues fixed in this commit
1. Remove the incorrect and duplicate pointer initialization in
sendPacket function.
2. Remove NULL check for the packet Id pointer passed to MQTT_DeserializeAck
when packet type is either CONNACK or PINGRESP.
* Coverage for MQTT_Init
* Remove mock for mqtt_lightweight
* Change to expected, actual order for TEST_ASSERT
* Provide updated comments for unity fixtures
* Add validation for context.nextPacketId
* Add tests for null parameters
* Add missing sc;
* Remove warning for suiteTearDown
* Do not return numFailures
* Return correct error code
* return numFailures
* Add docs
* Add implementation of receive loop
* Add keep alive to process loop
* Add timer to packet reception
* Add packet identifier to app callback
* Add publish info to app callback
* Add CMakeLists from v4 beta
* More cmake changes
* Successfully compile mqtt_demo_plaintext executable
* Add filePaths.cmake for mqtt demos
* Compile demos using cmake
* Add unity and cmock as submodules
* Add 3rdparty CMakeLists.txt
* Add example utest for http with cmake file
* Add tests directory for defining unit test
* Do not add dependency if mock_name is empty
* Make basic test finally work
* Remove tests/CMakeLists.txt
* Add separate folder for tests in bin
* Fix format
* Get logging to work
* Remove include_dir from create_test.cmake
* Remove duplicate unity 3rdparty library
* Add mock for mqtt tests
* Add README for unit testing
* Update README
* Compile all tests for coverage target
* Remove accidental Makefile
* Remove unity submodule
* Add more docs
* Update README
* Change CMAKE_C_STANDARD
* Update docs
* Indent correctly
* Add missing defines to config.h
* Link cmock to test target
* Remove double include of <stddef.h>
* Add comment for tools/cmock dir
* Address PR comments
* Move allutest README.md to a single docs folder in root
* Add steps to build the demos
* Update README.md with correct build steps
* Address PR comments
* Remove filePaths.cmake for demos
* Remove BUILD_CLONE_SUBMODULES
* Address PR comments
* Add BUILD_CLONE_SUBMODULES option
* Rename filepaths.cmake to filePaths.cmake
* Remove platform/include from filePaths.cmake
* Implement MQTT SUBSCRIBE and UNSUBSCRIBE
Please find the list of public API functions implemented
1. MQTT_Subscribe
2. MQTT_Unsubscribe
3. MQTT_GetSubscribePacketSize
4. MQTT_SerializeSubscribe
5. MQTT_GetUnsubscribePacketSize
6. MQTT_SerializeUnsubscribe
* Implement MQTT Publish
The list of functions implemented are
1. MQTT_Publish
2. MQTT_GetPublishPacketSize
3. MQTT_SerializePublish
4. MQTT_SerializePublishHeader
* Add state engine
* Remove packet ID collision check
According to 2.3.1 of the MQTT spec, since
client and server assign packet identifiers
independently, it's possible for concurrent
exchanges to use the same packet identifiers.
* Refactor state engine for simplicity
* Rename invalid state to null state
* Add state select
* Define bool for C89
* Add asserts to static functions
* Remove leading underscore from functions