Skip to content

MQTTv5 Implementation #316

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

Open
wants to merge 225 commits into
base: main
Choose a base branch
from
Open

MQTTv5 Implementation #316

wants to merge 225 commits into from

Conversation

adituc
Copy link

@adituc adituc commented Mar 11, 2025

Upgrading MQTT Library to support v5 features

Description

Test Steps

  • Unit Tests are added for all new and modified features.
  • Unit Tests for MQTTv5 functions are added in a separate folder in test.

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.

Comment on lines 5392 to 5396
else
{
status = MQTTBadParameter;
LogError(("Invalid property buffer"));
}
Copy link
Member

Choose a reason for hiding this comment

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

Here instead of returning BadParameter we should create a new status code something like MQTTPropertyEnd and return that. This will tell the user that there are no more properties in the packet.

@@ -63,7 +63,7 @@
struct MQTTPubAckInfo;
struct MQTTContext;
struct MQTTDeserializedInfo;

struct MqttPropBuilder;
Copy link
Member

Choose a reason for hiding this comment

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

We can remove this from here as this struct is not defined in this file.

Comment on lines +104 to +105
struct MqttPropBuilder* sendPropsBuffer,
struct MqttPropBuilder* getPropsBuffer);
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 replace these parameter types with MqttPropBuilder_t instead of struct MqttPropBuilder

MQTTStatus_t MqttPropertyBuilder_Init(MqttPropBuilder_t* pPropertyBuilder, uint8_t *buffer, size_t length)
{
MQTTStatus_t status = MQTTSuccess;
if (pPropertyBuilder == NULL || buffer == NULL || length == 0)
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 also include the check: if length > MQTT_MAX_REMAINING_LENGTH then we need to return bad parameter.

@adituc adituc marked this pull request as ready for review April 23, 2025 05:26
@adituc adituc changed the base branch from mqttv5-dev to main April 23, 2025 05:28
bool topicAlias = false;
bool payloadFormatIndicator = false;
bool correlationData = false;
pLocalIndex = &pLocalIndex[1];
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 make this function static if it is not being used anywhere outside this file.

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.

6 participants