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

Allow dynamic setting of message received handler #55

Closed
256dpi opened this issue Jan 26, 2017 · 2 comments
Closed

Allow dynamic setting of message received handler #55

256dpi opened this issue Jan 26, 2017 · 2 comments

Comments

@256dpi
Copy link
Owner

256dpi commented Jan 26, 2017

As proposed by @sandeepmistry:

[..], however the Wire and new I2S Arduino libraries have a function to called onReceive to set a function handler for received data (https://www.arduino.cc/en/Reference/WireOnReceive). It would be nice to have this, instead of forcing sketched to define void messageReceived(...).

@256dpi 256dpi added this to the v2 milestone Jan 26, 2017
@tigoe
Copy link

tigoe commented Mar 17, 2017

I like this idea. I would also suggest that the two extra parameters, (char * bytes, unsigned int length) be given defaults, since they're not used in the example sketches. Alternately maybe use an overloaded function signature?

If char * bytes is absolutely necessary, it'd be nice to make it a little more in line with the Arduino API style guide (https://www.arduino.cc/en/Reference/APIStyleGuide). I get around it by doing char bytes[].

I'm glad this is already on the milestone list. Thank you for making a very nice library!

@256dpi 256dpi mentioned this issue Apr 29, 2017
Merged
11 tasks
@256dpi
Copy link
Owner Author

256dpi commented Apr 29, 2017

This is beeing addressed in #59.

@256dpi 256dpi closed this as completed Apr 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants