-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WSL serial support #224
Add WSL serial support #224
Conversation
let result = ""; | ||
try { | ||
result = await execChildProcess( | ||
`powershell.exe -Command "$(cat wsl_get_serial_list.ps)"`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this compatible with both old wsl and wsl2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also source for this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the source in the file ? I though the code is small and general enough.
The .NET Framework 2.0 defines the System.IO.Ports.SerialPort
and should be independent of WSL version.
Will test it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its better to add source, in case in future we don't remember what code we wrote to generate this bin.
Also it will be much easier for git to track
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the source in wsl_get_serial_list.ps
53fb171
to
ad5d8b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested on win 10
I understand this changes ease the access to some people, but it has a few limitations IMHO:
This behavior (using powershell.exe and path substitution) shall only be used when the user specifies |
Add code to support get serial ports, flash and monitor on WSL.
Tested on Windows 10 19041 with WSL 2 with Microsoft Ubuntu 20.04 distribution for WSL.