-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
IDF v5.0 regression: mqtt not providing user_context
field (IDFGH-9261)
#10644
Comments
user_context
fielduser_context
field (IDFGH-9261)
Hi @jmattsson Yes, the field esp-idf/examples/protocols/mqtt/ssl/main/app_main.c Lines 135 to 136 in 236fa5e
(note that |
Oh! Okay, that explains a lot. Thanks @david-cermak ! Thanks again for the quick response. Feel free to close the issue (unless you want it to hang around for doc update reasons). |
migration-guides should mention this change. |
update CN for migration-guides/release-5.x/5.0/protocols.rst Co-Authored-By: Wang Zi Yan <[email protected]> Closes #10644
Answers checklist.
General issue report
Hi,
I'm working on porting the NodeMCU mqtt module from IDFv4 to IDFv5, but I've run into what seems to be a big issue.
Previously*, it was possible to set a "user context" pointer when initialising the client, and that pointer would then be handed back in each event. This followed the typical pattern for event driven libraries in C, where the caller is free to associate whatever context with a session and have it accessible at the time of handling the event.
In IDFv5**, I cannot find any support for this. Is it really intentional that such a fundamental aspect of the library has been changed/removed? I'm looking at a significant rewrite of the module code here if that's the case. By the looks of it I would have to establish and maintain an external
esp_mqtt_client_handle_t
to user context lookup structure in order to achieve what the olduser_context
field did. Obviously, I'd prefer to not have to do that.Have I overlooked something here? I can't find any mention of this change in the API documentation, release notes or migration notes.
I originally posted this on the forum but got no response there. This seems like quite a regression to me.
Thanks in advance.
*) See https://docs.espressif.com/projects/esp ... parameters
**) See https://docs.espressif.com/projects/esp ... figuration
The text was updated successfully, but these errors were encountered: