Skip to content
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

MQTT - dont send inside message receivers #33

Closed
3 tasks done
Tracked by #21
mitra42 opened this issue Oct 17, 2024 · 1 comment
Closed
3 tasks done
Tracked by #21

MQTT - dont send inside message receivers #33

mitra42 opened this issue Oct 17, 2024 · 1 comment
Labels

Comments

@mitra42
Copy link
Owner

mitra42 commented Oct 17, 2024

In control_demo_mqtt it sends a message with qos=1 while inside a message handler. This is a bad pattern (I forget where i read this, but it relates to qos=1 taking unpredictable time or something like that).

Instead suggestion is ....

  • xMqtt::messageReceived or similar should set & clear a flag
  • xMqtt::messageSend should queue messages if flag set
  • either (when the flag is cleared, or in xMqtt::loop if the flag is clear) it should send queued messages

Part of #21

@mitra42 mitra42 added the comms label Oct 17, 2024
@mitra42 mitra42 mentioned this issue Oct 17, 2024
19 tasks
@mitra42
Copy link
Owner Author

mitra42 commented Oct 18, 2024

Complete and tested

@mitra42 mitra42 closed this as completed Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant