-
Notifications
You must be signed in to change notification settings - Fork 109
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
base: main
Are you sure you want to change the base?
Conversation
source/core_mqtt_serializer.c
Outdated
else | ||
{ | ||
status = MQTTBadParameter; | ||
LogError(("Invalid property buffer")); | ||
} |
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.
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; |
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 can remove this from here as this struct is not defined in this file.
struct MqttPropBuilder* sendPropsBuffer, | ||
struct MqttPropBuilder* getPropsBuffer); |
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 replace these parameter types with MqttPropBuilder_t
instead of struct MqttPropBuilder
source/core_mqtt.c
Outdated
MQTTStatus_t MqttPropertyBuilder_Init(MqttPropBuilder_t* pPropertyBuilder, uint8_t *buffer, size_t length) | ||
{ | ||
MQTTStatus_t status = MQTTSuccess; | ||
if (pPropertyBuilder == NULL || buffer == NULL || length == 0) |
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 also include the check: if length > MQTT_MAX_REMAINING_LENGTH
then we need to return bad parameter.
bool topicAlias = false; | ||
bool payloadFormatIndicator = false; | ||
bool correlationData = false; | ||
pLocalIndex = &pLocalIndex[1]; |
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 make this function static if it is not being used anywhere outside this file.
Upgrading MQTT Library to support v5 features
Description
Test Steps
Checklist:
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.