hsaturn / TinyMqtt

ESP 8266 / 32 / WROOM Small footprint Mqtt Broker and Client
GNU General Public License v3.0
183 stars 40 forks source link

Pub ack #83

Closed real-bombinho closed 1 year ago

real-bombinho commented 1 year ago

Suggestion as per discussion.

It solves duplicate packets

real-bombinho commented 1 year ago

I have altered the PR to include the fix for #84 already. This might save you having to test twice. The fix for #84 was borrowed from this PR anyway, I just had originally kept the bit manipulation out your code as I was not sure if the omission was intentionally. The revised PR has the fix moved up a few lines to take effect in the earlier code too and corrected a mistake I had made (&& instead of &).

Instead of using PublishID() it would also be possible to fetch the ID bytes straight from [payload], this would prevent misuse of PublishID() out of context.

hsaturn commented 1 year ago

Thans for the PR, I'm closing it but have reflected changes with a unit test in https://github.com/hsaturn/TinyMqtt/commit/90435b1260568f1c5da07148903ae54f1c4cc0a4