corneliusmunz / legoino

Arduino Library for controlling Powered UP and Boost controllers
MIT License
257 stars 34 forks source link

Callback functions for connection status #47

Open Mattze0815 opened 3 years ago

Mattze0815 commented 3 years ago

Hi @corneliusmunz, would it be able to introduce some handy callbacks for the following events?

1. connecting(): hub is connecting

2. connected(): hub has been connected. Might only be useful if .connect() is converted into a non-blocking function as well.

3. disconnected(): hub has disconnected

Keep up to good work!

fvanroie commented 3 years ago

Indeed I think these callbacks will be very handy in a simplified flow. I proposed these as well in another comment proposal for the HubManager feature. This was in relation to Make connection flow easier #38.

I haven't looked at the new HubManager class yet, but I think these callbacks would align with that new feature...

corneliusmunz commented 3 years ago

@fvanroie @Mattze0815 I will try to consider this feature request in the work on the HubManager class. Unfortunately i found not so much time till now but during the holidays i will try to tackle this 😄