-
Notifications
You must be signed in to change notification settings - Fork 3.1k
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
callback functions mqtt #527
Comments
Looks like C internals only support one callback function per client instance. Data structure created here: Callback function stored here: Callback restored and called here: Also appears that the instance of m is pushed as an argument to your function. Example code here appears to be correct: API reference here appears to be wrong: |
Pity this wasn't fixed with #774. So, it's still wrong at http://nodemcu.readthedocs.org/en/dev/en/modules/mqtt/#mqttclientsubscribe |
ad 1. ad 2. |
When doing some subscribes consecutive, callback is always done from the last subscribe.
Output:
Subscribe 3
Subscribe 3
Subscribe 3
The same if consecutive publish's.
Text at API mqtt.client:subscribe() seems to be wrong:
Parameters
topic: a string topic to subscribe to
qos: qos subscription level, default 0
function(client, topic, message): callback fired when message received.
Parameters for callback function doesn't exist.
The text was updated successfully, but these errors were encountered: