More robust serial connection establishment & error handling#4
Merged
ni-c merged 8 commits intoni-c:masterfrom Oct 13, 2014
Merged
More robust serial connection establishment & error handling#4ni-c merged 8 commits intoni-c:masterfrom
ni-c merged 8 commits intoni-c:masterfrom
Conversation
Conflicts: examples/rc.js index.js lib/board.js lib/rc.js package.json src/du.ino
Instead of having both `src/du.ino` (old, invalid path) and `src/duino/duino.ino` (new), make the former a symlink to the latter. (The Arduino IDE requires this folder format.)
Instead of trying to establish the serial connection in the Board constructor, delegate this to a separate `setup()`. (**API change**!) This allows the user to add listeners to the Board’s `error` event, which signifies that the connection could not be established. (This was already intended, but wasn't possible, as far as I can tell.) Also displays a more intuitive error message.
This was referenced Oct 9, 2014
`setup()` returns `this`, which allows for an easier transition from old code: ``` var board = new arduino.Board(); // old var board = new arduino.Board().setup(); // new ```
Author
|
|
Owner
|
There is a confict in libs/board.js after merging the previous PR: <<<<<<< HEAD
this.debug = options && options.debug || false;
this.device = options && options.device || 'tty(USB|ACM|S)[0-9]?';
=======
this.debug = options && options.debug || false;
this.devregex = options && options.devregex || 'usb|ttyACM*|ttyS0';
>>>>>>> 00a7728c1850b44d32fd200e1ec3fbd579c0cbf6I have taken the version from this PR, i hope that was the right version? |
Author
|
Okay, cool. Yes, both work, but the bottom version matches false positives (e.g., |
Author
|
Heads up: This was commited without being resolved. Like I said, the bottom should be used. |
Owner
|
Ups, thank you, fixed it. That's strange, my merge-commit is in the history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of trying to establish the serial connection in the Board constructor, delegate this to a separate
setup(). (API change!)This allows the user to add listeners to the Board’s
errorevent, which signifies that the connection could not be established. (This was already intended, but wasn't possible, as far as I can tell.)Also displays a more intuitive error message.
Depends on #3. [Is this how you deal with Pull Request dependencies? I hope merging #3 will update this PR to only include the relevant, three most recent commits. This github stuff is more painful than I’d hoped.]