Skip to content

umqtt.simple publish with qos 1 pid rollover #94

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
peterhinch opened this issue Aug 25, 2016 · 2 comments
Open

umqtt.simple publish with qos 1 pid rollover #94

peterhinch opened this issue Aug 25, 2016 · 2 comments

Comments

@peterhinch
Copy link
Contributor

In continuously running data logging applications the pid value can overflow the 16 bit field. In this instance struct.pack_into constrains the result to 16 bits but produces an illegal value of 0 (MQTT spec section 2.3.1).

I don't know if this is also a valid concern but cPython's struct.pack_into throws an exception on overflow: if the MicroPython implementation ever became conformant the code would fail.

@pfalcon
Copy link
Contributor

pfalcon commented Aug 25, 2016

Is it speculative or did you really see mosquitto complain? How does it look? It's not hard to add proper wraparound.

@peterhinch
Copy link
Contributor Author

I've not tried a PID of 0. Merely a suggestion explicitly to code a transition from 0xffff to 1.

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

No branches or pull requests

2 participants