-
Notifications
You must be signed in to change notification settings - Fork 638
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
base: main
Are you sure you want to change the base?
Upgrade MQTT demos to v5 #1942
Conversation
@@ -97,7 +98,7 @@ | |||
* https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html | |||
* | |||
* @note This certificate should be PEM-encoded. | |||
* | |||
*m |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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?
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. |
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.