-
Notifications
You must be signed in to change notification settings - Fork 118
Add MQTT_Publish API with ACK handling #337
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: MQTTv5-reviewed-changes
Are you sure you want to change the base?
Add MQTT_Publish API with ACK handling #337
Conversation
e942ad7 to
49fbfc7
Compare
| LogDebug( ( "Packet identifier %hu.", | ||
| ( unsigned short ) *pPacketIdentifier ) ); | ||
|
|
||
| /* Packet identifier cannot be 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.
Should check this right after L727?
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.
I agree that L727 would be the better place. However, that breaks the pattern that we increment the index after we get a value out from the buffer. This will not cause any issues since as long as the return value of the function is not MQTTSuccess, any and all values returned by the function in the parameters are invalid and should not be consumed.
source/core_mqtt_serializer.c
Outdated
| pLocalIndex = &pLocalIndex[ variableLengthEncodedSize( propertyLength ) ]; | ||
|
|
||
| /*Validate the remaining length.*/ | ||
| if( remainingLength != ( propertyLength + variableLengthEncodedSize( propertyLength ) + 3U ) ) |
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.
I don't understand this check. What does remainingLength represent here? And why would it equal the length of the properties (encoded + decoded)? Why isn't this equal to variableLengthEncodedSize( propertyLength ) + 3U?
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.
It is an artifact of how the code was written earlier.
I reworked it. Let me know if that makes sense.
49fbfc7 to
2182737
Compare
2182737 to
e9942c7
Compare
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.