Skip to content

Commit bdabe86

Browse files
Upgrade the library to be compatible with MQTTv5 (#343)
## Description This PR introduces full MQTT v5.0 protocol support to the coreMQTT library. After merging, the library will exclusively support MQTT v5.0 and will no longer be compatible with MQTT v3.1.1. ### Breaking Change MQTT v3.1.1 support is removed. Users requiring MQTT v3.1.1 should use the last v3-compatible release: [coreMQTT v2.3.1](https://github.com/FreeRTOS/coreMQTT/tree/v2.3.1). ### What's New - **MQTT v5.0 protocol compliance** — properties, enhanced reason codes, bidirectional DISCONNECT, subscription options - **Property builder API** — MQTTPropBuilder_t with MQTTPropAdd_* and MQTTPropGet_* functions for all v5.0 properties - **Enhanced API signatures** — all core functions (MQTT_Connect, MQTT_Publish, MQTT_Subscribe, etc.) now accept optional property parameters - **Updated event callback** — returns bool and includes reason code and property parameters for bidirectional communication - **Connection properties** — MQTTConnectionProperties_t tracks server-negotiated values from CONNACK - **Subscription options** — noLocalOption, retainAsPublishedOption, retainHandlingOption in MQTTSubscribeInfo_t - **Backward-compatible usage** — all new parameters are optional (pass NULL/0 for v3.1.1-equivalent behavior) ### Migration See the [Migration Guide](MigrationGuide.md) for API-level changes and the [MQTT v5.0 Guide](MQTTv5Guide.md) for conceptual guidance on using v5.0 features. ### Development History This PR consolidates all reviewed and tested changes from [PR #343](#343), which contains the full commit history and review discussions. The work builds upon the foundation established in [PR #316](#316).
1 parent 08510aa commit bdabe86

262 files changed

Lines changed: 36096 additions & 7038 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.cSpellWords.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ misra
2828
Misra
2929
MISRA
3030
MQTT
31+
mqtteventcallback
32+
mqttpropadd
33+
mqttpropertybuilder
34+
mqttpropget
35+
MQTTV
3136
mypy
3237
nondet
3338
Nondet
@@ -37,6 +42,7 @@ pytest
3742
pyyaml
3843
serializemqttvec
3944
sinclude
45+
subscriptionid
4046
UNACKED
4147
unpadded
4248
Unpadded

.github/memory_statistics_config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
"src": [
44
"source/core_mqtt.c",
55
"source/core_mqtt_state.c",
6-
"source/core_mqtt_serializer.c"
6+
"source/core_mqtt_serializer.c",
7+
"source/core_mqtt_serializer_private.c",
8+
"source/core_mqtt_prop_serializer.c",
9+
"source/core_mqtt_prop_deserializer.c"
710
],
811
"include": [
912
"source/include",
13+
"source/include/private",
1014
"source/interface"
1115
],
1216
"compiler_flags": [

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
push:
1111
branches: ["**"]
1212
pull_request:
13-
branches: [main]
13+
branches: [main, MQTTv5-reviewed-changes]
1414
workflow_dispatch:
1515

1616
jobs:
@@ -83,6 +83,7 @@ jobs:
8383
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
8484
with:
8585
coverage-file: ./build/coverage.info
86+
branch-coverage-min: 93
8687

8788
complexity:
8889
runs-on: ubuntu-latest
@@ -92,7 +93,7 @@ jobs:
9293
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
9394
with:
9495
path: ./
95-
horrid_threshold: 12
96+
horrid_threshold: 30
9697

9798
doxygen:
9899
runs-on: ubuntu-latest
@@ -154,6 +155,7 @@ jobs:
154155
mkdir -p override-include
155156
cp source/include/stdbool.readme override-include/stdbool.h
156157
cp source/include/stdint.readme override-include/stdint.h
158+
cp source/include/inttypes.readme override-include/inttypes.h
157159
158160
# Build using the custom headers
159161
cmake -S test -B build/ \

0 commit comments

Comments
 (0)