1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-06-10 04:57:15 +08:00

360 Commits

Author SHA1 Message Date
Mark R. Tuttle
158af97bd0 Advance litani submodule for cbmc proofs to latest version 2021-10-15 10:16:48 -04:00
johnrhen
0f244d4454
Fix inconsistent log levels (#175)
* 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>
2021-09-30 09:49:54 -07:00
Joey Degges
c42daa1b82
Handle all enum values in switches (#174)
Non-functional change to handle all enum values for MQTTPublishState_t
and MQTTQoS_t in switch statements. This allows users to compile with
-Werror=switch-enum.
2021-09-24 19:01:13 -04:00
Muneeb Ahmed
33031789a1
Rename master references to main (#173) 2021-09-09 15:57:32 -07:00
Muneeb Ahmed
73eee0bd11
Update Doxygen to version 1.9.2 (#148) 2021-08-24 12:10:36 -07:00
Ronak Fofaliya
a1bbbf9a23
Updated aws-templates-for-cbmc-proofs submodule (#170) 2021-08-19 10:25:02 -07:00
Ronak Fofaliya
e2dcacfc02
testing expensive proofs (#169) 2021-07-23 12:15:06 -07:00
Muneeb Ahmed
51c8067bff
Update version and add C++ guards (#168)
* 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
v1.1.2
2021-07-22 16:49:59 -07:00
Archit Aggarwal
a108af5297
Remove debug log that can be problematic for non-blocking transport implementations (#167)
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.
2021-07-16 16:28:30 -07:00
Kareem Khazem
8786f32290
Upgrade proof tool submodules (#165)
This commit advances Litani to release 1.10.0, and the starter kit to
the tip-of-tree. This brings the following improvements:

- Profiling
    - Litani measures the memory usage of the CBMC safety checking and
      coverage checking jobs
    - The dashboard includes box-and-whisker diagrams for memory use per
      proof
    - The dashboard includes a graph of how many parallel jobs are
      running over the whole run, making it easy to choose a CI machine
      with enough parallelism
    - It is now possible to designate particular proofs as "EXPENSIVE";
      Litani runs expensive proofs serially, ensuring that they do not
      over-consume resources like RAM.

- UI improvements
    - Each pipeline page includes a table of contents
    - Each pipeline page includes a dependency graph of the pipeline
    - Each job on the pipeline page has a hyperlink to that job
    - The terminal output is now less noisy
2021-07-15 10:55:16 -07:00
Oscar Michael Abrina
76295c92f7
Update broken links (#166) 2021-07-14 13:56:09 -07:00
Muneeb Ahmed
d39236e732
Add check for 0 packet ID for subacks (#159)
* Add check for 0 packet ID for subacks

* Sort lexicon.txt
2021-07-07 20:11:00 -07:00
Muneeb Ahmed
a7818cbee3
Fix description of CBMC in README (#164) 2021-07-07 13:24:21 -07:00
Muneeb Ahmed
6b222a7c51
Fix keep alive interval check (#163)
* Fix keep alive checking interval

* Update default ping response timeout to a more reasonable value

* Update changelog

* Update doc for MQTT_PINGRESP_TIMEOUT_MS
2021-07-01 10:13:11 -07:00
Nicholas Rodgers
f756d9833a
Update litani and starter kit submodules (#158)
Update litani to version 1.6.0 and starter kit to tip of tree
2021-03-30 11:12:36 -07:00
Archit Aggarwal
6b1336f662
Update release job to support deleting duplicate tag and release (#156)
* Update release job to support deleting existing tag and release

* Update conditional for tag-commit job

* Update default value to be a string

* Update parameter description

* Fix typo

* Fix whitespace
2021-03-03 15:11:09 -08:00
Muneeb Ahmed
b6c4ae8b27
Change http links to https (#155) 2021-03-02 12:25:58 -08:00
Archit Aggarwal
ffb68182ab
Update URL to memory estimates in README (#154) v1.1.1 2021-02-28 10:36:41 -08:00
Archit Aggarwal
363a2fbca2
Update CHANGELOG and file versioning for upcoming release (#153) 2021-02-25 13:56:58 -08:00
leegeth
77ab18a4ed
Use python 3.7.10 memory estimator (#152)
* Use python 3.7.10 for doxygen and link verifier.
2021-02-18 17:20:58 -08:00
Archit Gupta
81f265d6a5
Add workflow to generate doxygen size tables (#151)
* Add manual workflow for generating size table
* Add memory statistics PR check
2021-01-22 13:40:27 -08:00
David Chalco
1a201a1fe6
Example code - fix incorrect struct member (#150) 2021-01-19 13:26:07 -08:00
Mark R. Tuttle
48ab9456f7 Update litani submodule 2021-01-11 20:30:22 -05:00
Archit Aggarwal
103b5daa86
Update CI workflow to use new action for coverage check (#146)
Use the coverage-cop custom GitHub action for coverage compliance check of branch and line coverages of unit tests.
2020-12-24 10:41:40 -08:00
Archit Aggarwal
e995d36a00
Update CI checks workflow to use GitHub Actions for quality checks (#145)
Migrate coreMQTT to use the actions for code quality checks in FreeRTOS/CI-CD-GitHub-Actions
2020-12-23 16:37:28 -08:00
leegeth
221687abfc
Update memory numbers in Doxygen to be in sync with FreeRTOS.org (#143) 2020-12-22 18:11:47 -08:00
Archit Aggarwal
843cf9924f
Update timeout section in doxygen manual to match API behavior in v1.1.0 (#142)
Update the sub-section of the Design page of the library API reference to provide detailed information about the role of runtime timeout and compile-time timeout configurations in the behavior of MQTT_Connect, MQTT_ProcessLoop and MQTT_ReceiveLoop functions.
2020-12-17 14:53:46 -08:00
Archit Aggarwal
ff9830a338
Update README with LTS information (#141) v1.1.0 2020-12-15 06:53:55 -08:00
SarenaAWS
3ef8ac1f77
Add Doxygen doc words to the lexicon.txt. (#140) 2020-12-13 10:01:57 -08:00
Muneeb Ahmed
e9f7c38736
Update Changelog for v1.1.0 (#129) 2020-12-11 15:47:07 -08:00
Archit Aggarwal
84e0c7e95e
Add section about metrics reporting in README (#137)
* Add section for reporting metrics in README
2020-12-11 10:55:28 -08:00
Muneeb Ahmed
096ec21c55
Check for empty topic filters in subscribes (#139)
* Validate each topic filter in a subscribe or unsubscribe packet is of nonzero length
2020-12-11 01:26:18 -08:00
leegeth
82eea34765
Update timeout doc (#138)
Co-authored-by: Archit Aggarwal <architag@amazon.com>
2020-12-10 17:40:05 -08:00
Archit Aggarwal
c7a2c898b3
Update API documentation of transport send/recv functions (#136)
Update API of the transport interface functions for the following:

* Transport recv() should NOT block when requested to read a single byte. It MAY block for the underlying socket timeout when requested to read n > 1 bytes.
* Transport send() should NOT return an error when the send fails because of a full TX buffer of the underlying network stack, so that the calling library can retry the send operation.
2020-12-09 22:25:48 -08:00
SarenaAWS
cf7406a98c
Add the current version as a macro to the library. (#135)
So that the version can be used in metrics collection and anywhere else it is needed.
2020-12-09 17:25:50 -08:00
SarenaAWS
d96960ec8d
Update v1.0.1 to v1.1.0 and 202011.00 to 202012.00 for memory estimates link. (#131) 2020-12-09 11:33:30 -08:00
Archit Aggarwal
9ef7fe91c1
Add doc that keep-alive is unsupported with dummy timer (#132)
Update API doc to mention that the keep-alive mechanism is not supported by MQTT_ProcessLoop API when a dummy timer function that always returns zero is supplied to the library.
2020-12-09 10:57:07 -08:00
leegeth
ecf9b73e1e
Add timeouts in doxygen docs (#133)
Co-authored-by: abhidixi11 <44424462+abhidixi11@users.noreply.github.com>
2020-12-09 10:30:02 -08:00
Muneeb Ahmed
fdfb78df4b
Remove references to MQTT from readme headers (#130)
* Remove references to MQTT from readme headers

* Move parenthesis
2020-12-08 21:42:13 -08:00
Archit Aggarwal
037a2510c6
doc: add info to set timeout configs to zero when timer is dummy (#128) 2020-12-08 15:29:18 -08:00
Archit Aggarwal
510a3f6eca
Update APIs to detect partial sends as failures (#127)
* Fix issue of data recv being interrupted

* Rename elapsedTimeMs variable to its express its new meaning

* Use configuration const for recvExact timeout

* Remove timeout check from discardPacket and address CI check failures

* Fix more CI check failures

* Remove another unused local variable

* Re-instate timeout in discard to reduce scope of changes

* Remove unused variable again

* Fix failing unit test

* Rename new config macro, and attempt to fix CBMC failures

* Doc: Improvement suggestions from code review

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

* Fix quality check failures

* Add test case to check partial network reads with zero timeout duration for ProcessLoop

* style: Improving naming

* Address complexity failure

* Address comments

* Doc: Add blocking time equation of Receive/ProcessLoop functions in their API doc

* Improvement in API doc

* Set MQTT_RECV_POLLING_TIMEOUT_MS so that recvExact runs in one iteration always for cbmc.

* doc: Add information about zero return value for Transport_Recv_t

* fix: prevent possibility of infinite loop in timeout logic of ProcessLoop

* style: Minor changes

* hygiene: minor name fix

* fix: Possibility of infinite loop in sendPacket

* Add the new configuration to doxygen

* test: Add mock transport send function that always returns zero

* fix: Issues in sendPacket and sendPublish

* test: add test for sendPacket timeout

* Update Timer Overflow test

* test: temporarily comment out unused variable

* test: fix the timer overflow test

* Address review comments

* style: make log messages concise

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

* Update call sites of sendPacket to treat partial sends as failure

* test: Add send timeout coverage for APIs calling sendPacket

* test: Add coverage for send timeout in APIs calling sendPacket

* test: review feedback

* ci: address spell check error

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>
Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-07 16:02:39 -08:00
Archit Aggarwal
c0cba82ded
Fix tag verification when using commit SHA (#126) 2020-12-07 13:19:19 -08:00
Archit Aggarwal
0a2172b896
Fixes in internal logic of sending packets (#124)
* Fix issue of data recv being interrupted

* Rename elapsedTimeMs variable to its express its new meaning

* Use configuration const for recvExact timeout

* Remove timeout check from discardPacket and address CI check failures

* Fix more CI check failures

* Remove another unused local variable

* Re-instate timeout in discard to reduce scope of changes

* Remove unused variable again

* Fix failing unit test

* Rename new config macro, and attempt to fix CBMC failures

* Doc: Improvement suggestions from code review

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

* Fix quality check failures

* Add test case to check partial network reads with zero timeout duration for ProcessLoop

* style: Improving naming

* Address complexity failure

* Address comments

* Doc: Add blocking time equation of Receive/ProcessLoop functions in their API doc

* Improvement in API doc

* Set MQTT_RECV_POLLING_TIMEOUT_MS so that recvExact runs in one iteration always for cbmc.

* doc: Add information about zero return value for Transport_Recv_t

* fix: prevent possibility of infinite loop in timeout logic of ProcessLoop

* style: Minor changes

* hygiene: minor name fix

* fix: Possibility of infinite loop in sendPacket

* Add the new configuration to doxygen

* test: Add mock transport send function that always returns zero

* fix: Issues in sendPacket and sendPublish

* test: add test for sendPacket timeout

* Update Timer Overflow test

* test: temporarily comment out unused variable

* test: fix the timer overflow test

* Address review comments

* style: make log messages concise

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>
Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-07 10:37:26 -08:00
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
Kareem Khazem
77e7c0168a
Update litani submodule pointer (#108)
This update ensures that final proof results get posted to GitHub even
when there are proof failures.
2020-12-04 11:35:06 -08:00
Muneeb Ahmed
73472634c6
Use stdbool.h always(#118)
* Add custom stdbool.readme file

* Add custom stdint.readme file

* Add GitHub Action to test .readme headers

* Tested GA by pushing an invalid file
2020-12-04 10:26:49 -08:00
Archit Aggarwal
8431dbe061
Automate release of coreMQTT with GitHub Action Job (#121)
Add a GitHub Action job to trigger a release process which includes operations of:

1. Creating and pushing the release tag to the repository
2. Verifying the pushed tag (performing a diff with the commit ID which is tagged)
3. Creating a ZIP for the release asset.
4. Verifying the ZIP by performing a diff check and running unit tests on the unzipped files. 
5. Creating a release on the repository for the tag, and uploading the ZIP as the release asset
2020-12-04 10:19:46 -08:00
Oscar Michael Abrina
8de05fa001
Fix typo in MQTT_Unsubscribe code example (#122)
This fixes a typo in the code example that was raised in issue #119
2020-12-04 10:00:31 -08:00
Muneeb Ahmed
ca492a40f0
Fix incorrect size compiler warning (#116) 2020-12-01 19:17:48 -08:00