Skip to content
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 support for less standard serial port speeds on macOS #44052

Merged
merged 2 commits into from
Nov 24, 2020

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Oct 30, 2020

It seems like macOS terms end with B230400 (probably limit of legacy serial) but many USB serial devices can do more.
When .NET tries to use higher speed it always fails as we fail to lookup platform speed mapping. macOS has call to set specific speed so this PR use that as fallback if speed lookup fails. That leaves the decision to driver and OS e.g. it will either succeed or fail and we report that accordingly.

I don't have enough gear to but I was able to verify that serial port can be opened with speed beyond B230400.

fixes #43719

@danmoseley
Copy link
Member

cc @krwq

@krwq
Copy link
Member

krwq commented Nov 2, 2020

codewise LGTM, we will need someone with the right hardware to test this, @MicBoucinha any chance you could try this out? (easiest way is to sync with @wfurt's branch, build the repo and test this code inside of tests directory which will use the right binaries automatically)

@wfurt
Copy link
Member Author

wfurt commented Nov 2, 2020

I was planning to write instructions how to grab bits from this PR. (I just did not get to it over the weekend)

@wfurt
Copy link
Member Author

wfurt commented Nov 2, 2020

(and I plan to keep it as draft until we get verification)

@MicBoucinha
Copy link

@krwq I tested it and it works on my machine. I followed the instructions left by wfurt on the issue #43719 (comment)

@wfurt
Copy link
Member Author

wfurt commented Nov 3, 2020

Thanks @MicBoucinha for confirmation.

@wfurt wfurt marked this pull request as ready for review November 3, 2020 19:37
@wfurt wfurt requested a review from krwq November 3, 2020 19:37
@wfurt wfurt added the os-mac-os-x macOS aka OSX label Nov 10, 2020
@wfurt
Copy link
Member Author

wfurt commented Nov 10, 2020

can you please take final look @krwq? It seems like this works as expected.

@wfurt
Copy link
Member Author

wfurt commented Nov 19, 2020

ping @krwq?

Copy link
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, got flooded with notification and missed it, LGTM

@wfurt wfurt merged commit d73c65e into dotnet:master Nov 24, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.IO.Ports - Unable to open a SerialPort when BaudRate is set to 1M on a Mac
6 participants