Skip to content

Added lambda feature for onMessage callback. Fixes #147 #175

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

Closed
wants to merge 2 commits into from

Conversation

rcarle3911
Copy link

It allows the use of lambdas to access class reference. For example.

client.onMessage( [this] (String &topic, String &payload) { Serial.println("Member Variable: " + String(this->myVar)); Serial.println("incoming: " + topic + " - " + payload); });

@256dpi
Copy link
Owner

256dpi commented Oct 29, 2019

Thanks for contributing this! As you can see from the Travis logs the "functional" library is not available on all Arduino platforms... We need to add some macros to remove the code on platforms that do not support it. Would be able to look into that?

@rcarle3911
Copy link
Author

rcarle3911 commented Oct 29, 2019 via email

@256dpi
Copy link
Owner

256dpi commented Nov 9, 2020

Closing in favor of #220.

@256dpi 256dpi closed this Nov 9, 2020
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

Successfully merging this pull request may close these issues.

2 participants