Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adituc
Copy link

@adituc adituc commented May 26, 2025

Upgrading MQTT Library to support v5 features

Description

This PR adds a demo application to showcase MQTT version 5.0 functionality using the coreMQTT library. It demonstrates establishing a connection with a broker, subscribing to a topic, publishing a message, receiving Incoming publishes, unsubscribing from a topic, and finally disconnecting.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@DakshitBabbar
Copy link
Member

As all these demos initially were written to work with MQTTv3, neither of these support processing an incoming disconnect packet in their event callback. We should add that handler as well in all the demos. This would also be an addition to the migration guide for the new version of the coreMQTT library.

Copy link
Member

@DakshitBabbar DakshitBabbar left a comment

Choose a reason for hiding this comment

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

Thanks @adituc for these changes. I have added some comments. Please have a look at them.

@DakshitBabbar
Copy link
Member

DakshitBabbar commented Jun 12, 2025

The function prvMQTTUpdateSubAckStatus in the mqtt_serializer_demo is also supposed to be updated to increment the pointer to the start of the payload. Right now it points to the start of properties. For other demos we use the MQTT_GetSubackSatusCodes API so that should be alright once that API is also updated to return the pointer to the payload and not the properties.

@adituc
Copy link
Author

adituc commented Jun 23, 2025

The function prvMQTTUpdateSubAckStatus in the mqtt_serializer_demo is also supposed to be updated to increment the pointer to the start of the payload. Right now it points to the start of properties. For other demos we use the MQTT_GetSubackSatusCodes API so that should be alright once that API is also updated to return the pointer to the payload and not the properties.

MQTT_GetSubackStatusCodes API has been updated to provide the start of the payload of the Suback, instead of the start of the properties.

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.

3 participants