1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-05-19 21:00:31 +08:00

28 Commits

Author SHA1 Message Date
Archit Gupta
b9dfc361f2 Combine config default headers
The loggging defaults were split out since they are not namespaced to
coreMQTT, and they previously leaked to all files including a coreMQTT
header. Splitting them allowed the logging defaults to only be pulled
into coreMQTT source files. Now that no header files use the config
headers, and thus all coreMQTT config only affects coreMQTT source
files, the split is no longer needed.
2024-02-01 14:44:28 -08:00
Aniruddha Kanhere
19d198c8cb
Update Doxygen to use latest ubuntu version and updated config file. (#234)
* Initialise variables in test before use

* Init variables in serializer tests

* Update uncrustify runner OS version

* Update doxygen config and doxygen used to latest

* Update brief and remove unused return description

* Update python version for latest ubuntu image
2022-11-23 22:18:34 +05:30
Aniruddha Kanhere
2775242743
[V2.1.0] Update version numbers and .md files for release (#228)
* Add SPDX identifier to source files

* Add license information to CBMC stub

* Fix spellcheck and the formatting

* Update version numbers and .md files for reelase

Co-authored-by: jasonpcarroll <23126711+jasonpcarroll@users.noreply.github.com>
2022-10-13 12:14:55 -07:00
Aniruddha Kanhere
dafa7c89e6
Add SPDX identifier to source files (#226)
* Add SPDX identifier to source files

* Add license information to CBMC stub

* Fix spellcheck and the formatting
2022-10-11 18:56:37 -07:00
Aniruddha Kanhere
b04c65f3c1
Fix bugs in receiveSingleIteration and optimize sendMessageVector (#218)
* Update the timout check in the send function

* Fix direction of check

* Allow processing of data in the buffer

* Fix formatting and unit-tests

* Update comment to clarify control flow

* Fix Disconnect CBMC proof and update size table

* Fix formatting and CBMC proofs

* Fix last CBMC proof

* Fix broken unit tests and add branch coverage
2022-09-21 15:26:58 -07:00
Aniruddha Kanhere
e5643a3e37
Update version numbers and .md files for release (#215)
* Update version number to 2.0.0

* Update changelog, readme and remaining version numbers
2022-09-19 16:31:54 -07:00
Aniruddha Kanhere
ee13cbdb27
Bring in changes from dev branch to main (#214)
* Update ci.yml (#197)

* Update ci.yml

* Add main branch in the CI YAML

* Add cancel callback API (#196)

* Add cancel callback command

* Update the function name

* Fix formatting

* Update memory estimates

* Add State to MQTT_ProcessLoop so that it can be called in a non-blocking manner (#198)

* Add stateful process-loop function

* Add extra checks; fix bugs and add description of functions

* Add index based stateful processloop

* Clean up

* Renamed functions to make them more coherent with their function

* Remove unused function declarations

* Fixed failing CI checks from previous commits except unit-test

* Fixed spell check and updated size-table

* Fix CBMC proofs

* Empty-Commit to trigger CBMC proofs

* Fix loop unwinding values in the Makefile

* Add upper bound on the buffer size of MQTT

* Increase minimum limit on buffer size to >0

* Add upper bound on the size of the buffer as well

* CBMC: Add memmove stub to accelerate coverage

The commit adds a stub for memmove accelerate CBMC coverage
calculation.  Without this stub, coverage for `MQTT_ProcessLoop` and
`MQTT_ReceiveLoop` fails to converge (gets stuck generating the SAT
formula for the memmove in `receiveSingleIteration`).  This stub
checks that src and dst are nonnull pointers and havocs dst.

* Fix formatting

Co-authored-by: Aniruddha Kanhere <ubuntu@ip-172-31-25-12.us-west-2.compute.internal>
Co-authored-by: Mark R. Tuttle <mrtuttle@amazon.com>

* Remove the use of common buffer (#199)

* Make publish use internal buffers

* Fix comment about packet ID

* Try a different approach for ping and disconnect

* Use writev and flush in conjuction with send

* Update the publish method to use vectors

* Add vectored IO to all functions

* Fix formatting

* Reduce complexity score

* Fix spell check and complexity score

* Fix breaking build

* Add doxygen comments

* Fix doxygen part 2

* Doxygen fix part 3

* Fix doxygen part 4

* Fix some checks

* Fix memory tables

* Fix some small errors

* Fix compiler warnings and breaking CI checks from previous commit

* Fix spell check and doxygen

* Fix a couple of CBMC proofs

* Fix ping and publish proofs

* Update the function name

* Fix more CBMC proofs

* Fix MQTT Connect proof

* Add unwinding loops

* Fix last CBMC proof

* Fix formatting

* Update the Subscribe and Unsubscribe functions

* Fix formatting and doxygen checks

* Fix broken CBMC proofs

* Fix memory statistic table

* Revert changes from serializer source

* update comments to clarify write requirements

* Add a note for write function pointer

* Fix spell check

* Update changelog (#202)

* Update MQTT logging so that log levels of the library do not leak (#205)

* Replace publish state arrays with pointers
Added an MQTT_InIt function for QoS > 0 publishes
Fixed functions which were dealing with state arrays

* Fix CI checks and clean up

* Fix CBMC proofs

* Fix sub and unsub CBMC proofs

* Fix remaining proofs

* Fix remaining CI checks

* Fix spell check

* Minor typo fix (#209)

* Update core_mqtt.h (#208)

* Update core_mqtt.h

* Update core_mqtt.h

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Update documentation and Doxygen comments in the source (#206)

* Update comments of the MQTT_InIt function

* Updating documentation of more of functions

* Fix formatting and spell check

* Update core_mqtt.h

* Add hooks to the source code (#200)

* Add mutex hooks

* Clean up of code

* Add doxygen comments and fix spell check

* Fix LogError call

* Fix formatting and memory table

* Fix dereference failure

* Update the hook names

* Fix broken builds

* Update the macros and variables

* Reword the briefs of hooks and uncrustify

* Fir formatting

* Protect get packet ID

* Fix formatting

* Fix Unit tests (#212)

* Fix Unit tests

* Update unit tests after new changes

* Fix more UT

* add dummy calls to the transport

* fix build error

* Remove usused variables

* Remove unsused variables

* Remove usused variables

* Unsued parameter

* Fix ut failure

* Fix uninitialized unit test variables

* Fix ut expectation

* Fix unit-tests

* Fix unit test uninitialized variable

* increase unit test coverage

* increase unit test coverage

* Fix unit test build

* State coverage 100%

* Serializer 100% coverage

* 100% UT coverage

* Fix formatting

* Fix size table

* Address PR comments

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Remove unnecessary ternaries (#211)

Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>

* Fix misra deviations  (#213)

* MISRA compliance update 1

* Fix MISRA errors

* Zero MISRA violations; 13 suppressed

* Fix CI checks

* Update MISRA.md

* Remove deviations

* Fix MISRA.md file

* Fix bug - wasn't incrementing vector length properly.

* Remove unwanted files

* Update comment to clarify the control flow of UT

* Remove 'dev' branch from the CI checks

* Update horrid threshold = 10

Co-authored-by: Aniruddha Kanhere <ubuntu@ip-172-31-25-12.us-west-2.compute.internal>
Co-authored-by: Mark R. Tuttle <mrtuttle@amazon.com>
Co-authored-by: jasonpcarroll <23126711+jasonpcarroll@users.noreply.github.com>
Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>
2022-09-19 14:14:55 -07:00
Soren Ptak
ec3380e5f1
Updating copyright year to match coreHTTP (#210) 2022-09-09 14:23:30 -07:00
Archit Gupta
b313f0bdbb
Remove config header include in coreMQTT headers (#189)
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.
2022-03-18 15:24:01 -07:00
Muneeb Ahmed
785f2f2117
Update version to 1.2.0 (#179) 2021-11-11 12:17:38 -08: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
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
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
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
Archit Aggarwal
363a2fbca2
Update CHANGELOG and file versioning for upcoming release (#153) 2021-02-25 13:56:58 -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
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
Muneeb Ahmed
ca492a40f0
Fix incorrect size compiler warning (#116) 2020-12-01 19:17:48 -08:00
Muneeb Ahmed
e1b81ae409
Remove %.*s format specifier from logs (#117) 2020-12-01 18:16:53 -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
7f0478d13a
Remove const qualifier from send/recv in transport interface (#86)
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.
2020-10-21 11:12:28 -07: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
Muneeb Ahmed
38f24af76c
Set NULL payloads and fix unit test (#71)
* 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
2020-09-18 17:40: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
abhidixi11
9e62b8daac
Session present flag fix. (#56)
Update deserializeConnack private function to set output parameter flag when session present bit is not set in CONNACK response
2020-09-12 13:12:28 -07:00
Archit Aggarwal
d355bfa259
Re-brand lightweight MQTT as MQTT serializer (#29)
Rename all instance of "lightweight" MQTT with "serializer" in files and documentation
2020-09-03 14:56:32 -07:00