-
Notifications
You must be signed in to change notification settings - Fork 229
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
Change messageReceived signature? #38
Comments
Actually this would also fix a serious bug as creating a String from the payload using |
Is not very user friendly, but can be better! |
What is not very user friendly? The current implementation or this proposed change? This would be a breaking change and result in releasing a v2. |
Sorry for the language ;)
or in the examples as a comment. |
Thanks for the clarifications. I'll keep you updated. |
Note to myself: To support multiple clients at the same time the signature could even be updated to something like this: void messageReceived(MQTTMessage msg, MQTTClient* client) {
Serial.print("incoming: ");
Serial.print(msg.topic());
Serial.print(" - ");
Serial.print(msg.payload());
Serial.println();
} |
Regarding #38 (comment), in general it would be nice to avoid pointers in the call back, as from my understanding most Arduino users aren't exposed to them. |
Has been simplified in #59. |
I have the feeling the current signature is a little complicated for amateurs.
So rather than:
We could have something like this:
Then we would also have the ability to add more convenience functions like:
The text was updated successfully, but these errors were encountered: