Skip to content

Upgrade MQTT demos to v5 #1942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

Upgrade MQTT demos to v5 #1942

wants to merge 22 commits into from

Conversation

adituc
Copy link

@adituc adituc commented May 20, 2025

Upgrading MQTT Library to support v5 features

Description of changes:
This PR updates all demo applications in the repository that use MQTT to use MQTT v5.0 instead of MQTT v3.1.1. The goal is to align the demo code with the newer version of the MQTT protocol.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@@ -97,7 +98,7 @@
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
*
* @note This certificate should be PEM-encoded.
*
*m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove any and all changes made in the demo_config.h files unless it is related to the MQTTv5 upgrade.

@@ -17,6 +17,8 @@ add_executable(
${BACKOFF_ALGORITHM_SOURCES}
)

target_sources(${DEMO_NAME} PRIVATE ${ROOT_DIR}/libraries/standard/coreMQTT/source/core_mqtt_utils.c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this file to the cmake files of all the demos, we should add it to the MQTT_SOURCES cmake variable defined in the coreMQTT repository in the file: /mqttFilePaths.cmake

@@ -66,7 +66,6 @@
*
* In general, port 1883 is for unsecured MQTT connections.
*/
#define BROKER_PORT 1883
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these demo_config.h files should contain these port numbers by default. Hence we should keep them as they are.

{
assert( pMqttContext != NULL );
assert( pPacketInfo != NULL );
assert( pDeserializedInfo != NULL );
assert( pDeserializedInfo->packetIdentifier != MQTT_PACKET_ID_INVALID );
// assert( pDeserializedInfo->packetIdentifier != MQTT_PACKET_ID_INVALID );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this assert removed?

@DakshitBabbar DakshitBabbar marked this pull request as ready for review May 20, 2025 09:40
@DakshitBabbar
Copy link
Member

Thanks @adituc for this PR. The changes look good to me. We will merge this PR once the coreMQTT release is made and we update the submodule pointer here to the latest release of coreMQTT.

@DakshitBabbar DakshitBabbar marked this pull request as draft May 20, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants