This repository was archived by the owner on Mar 23, 2021. It is now read-only.
Add port initialization and validation for SerialCommunicator#22
Open
sabicalija wants to merge 1 commit intoasterics:GUIelectronfrom
Open
Add port initialization and validation for SerialCommunicator#22sabicalija wants to merge 1 commit intoasterics:GUIelectronfrom
sabicalija wants to merge 1 commit intoasterics:GUIelectronfrom
Conversation
1. test all serial devices for AT COM support 1. proceed with first valid port
benjaminaigner
approved these changes
Dec 6, 2019
Collaborator
benjaminaigner
left a comment
There was a problem hiding this comment.
Really nice work, thanks @sabicalija 👍
| console.log( | ||
| `Found AT COM device at ${comName}` | ||
| ); | ||
| port.close(); |
Collaborator
There was a problem hiding this comment.
Maybe we use the parser event for a fully received line?
parser.on('data' ...
Contributor
Author
There was a problem hiding this comment.
Oh. I didn't know about this possibility.
Sure. I think you're right. It's probably better to safeguard the communication/transmission somehow.
Comment on lines
+97
to
+104
| this.getPorts = function() { | ||
| if(_port) { | ||
| var list = new Array(); | ||
| _port.list().forEach( function(port) { | ||
| list.push(port['path'] + port['manufacturer']); | ||
| }); | ||
| return list; | ||
| } |
Collaborator
There was a problem hiding this comment.
I think we can remove this block?
Contributor
Author
Collaborator
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.


I've implemented the search strategy as discussed today. The easiest solution I could come up with is to provide a
init()function forSerialCommunicator.The
init()function returns aPromisewhich is resolved after the correct port is set.I've changed the communication with the serial device a bit. Right now the program tests if the serial device responds with
FABI v2.3after anAT IDcommand. This should be changed of course for the correct device (i.e., FlipMouse).Wouldn't it be better to test for multiple FlipMouse devices and let the user select which one should be used?