In the current design, when you construct the Arduino object in Rhyduino, it doesn't open a connection to the hardware automatically. Would you like to see this changed so that the connection is opened automatically? If so, vote for this item.
Downside of the feature change:
- The constructor potentially takes longer to complete, and constructors should always return quickly.
- I could move the connection code to a separate thread and return from the constructor immediately, but that adds additional complexity and error checking for the developer using the library.
Upside of the feature change:
- If I implemented it with lazy connect logic, meaning I don't try to open the connection until the moment it needs to be opened, then I'd have a solution to a different issue I've been running through my mind. It's the issue of how to handle an Arduino that
has been disconnected from the system and reconnected while a Rhyduino app is running. I expect that Rhyduino would feel like everything was all cool until it tried to send a message and then it would fail. If it failed because the connection had been closed
(because the port disappeared) then with the lazy connect logic it would simply try to reopen the connection.