Suggestion - Auto-connect to Arduino should be the default behavior.


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.
Closed Jun 27, 2010 at 4:41 AM by RhyMednick


RhyMednick wrote Jun 27, 2010 at 4:40 AM

I decided to go ahead and implement this. It makes you can still open the connection immediately if you like, but if you attempt to post a message without opening the port then it'll be opened for you.

wrote Jun 27, 2010 at 4:41 AM

Resolved with changeset 71432.

wrote Feb 14, 2013 at 6:58 PM

wrote May 16, 2013 at 6:54 AM