Commit bdabe86
authored
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
- .github
- workflows
- docs/doxygen
- include
- source
- include
- private
- interface
- test
- cbmc
- include
- proofs
- DecodePubAckProperties
- DeserializeConnackProperties
- DeserializeHelpers
- DeserializePublishProperties
- MQTTPropGet_AssignedClientId
- MQTTPropGet_AuthData
- MQTTPropGet_AuthMethod
- MQTTPropGet_ContentType
- MQTTPropGet_CorrelationData
- MQTTPropGet_MaxPacketSize
- MQTTPropGet_MaxQos
- MQTTPropGet_MessageExpiryInterval
- MQTTPropGet_PayloadFormatIndicator
- MQTTPropGet_ReasonString
- MQTTPropGet_ReceiveMax
- MQTTPropGet_ResponseInfo
- MQTTPropGet_ResponseTopic
- MQTTPropGet_RetainAvailable
- MQTTPropGet_ServerKeepAlive
- MQTTPropGet_ServerRef
- MQTTPropGet_SessionExpiry
- MQTTPropGet_SubsIdAvailable
- MQTTPropGet_SubscriptionId
- MQTTPropGet_TopicAliasMax
- MQTTPropGet_TopicAlias
- MQTTPropGet_UserProp
- MQTTPropGet_WildcardId
- MQTT_Connect
- MQTT_DeserializeAck
- MQTT_DeserializeDisconnect
- MQTT_DeserializePublish
- MQTT_Disconnect
- MQTT_GetBytesInMQTTVec
- MQTT_GetIncomingPacketTypeAndLength
- MQTT_GetNextPropertyType
- MQTT_GetPacketId
- MQTT_GetSubAckStatusCodes
- MQTT_Init
- MQTT_MatchTopic
- MQTT_Ping
- MQTT_ProcessLoop
- MQTT_Publish
- MQTT_ReceiveLoop
- MQTT_SerializeAck
- MQTT_SerializeConnect
- MQTT_SerializeDisconnect
- MQTT_SerializeMQTTVec
- MQTT_SerializePingreq
- MQTT_SerializePublishHeader
- MQTT_SerializePublish
- MQTT_SerializeSubscribe
- MQTT_SerializeUnsubscribe
- MQTT_SkipNextProperty
- MQTT_Subscribe
- MQTT_Unsubscribe
- deserializeSubUnsubAckProperties
- validateIncomingDisconnectProperties
- sources
- stubs
- unit-test
- logging
- tools/cmock
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
0 commit comments