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

Update to a higher baudrate(460800 or 921600) is impossible on MacOS #2699

Open
baweiji opened this issue Sep 7, 2023 · 0 comments
Open

Comments

@baweiji
Copy link

baweiji commented Sep 7, 2023

SerialPort Version

11.x.x

Node Version

v14.18.0

Electron Version

No response

Platform

Darwin xxx 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar 9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64 x86_64

Architecture

No response

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

const serialPort = new SerialPort({path:'xxx', baudRate:230400});

serialPort.update({baudRate:460800}, (err)=>{console.log(err)});

What happens?

Received error in callback, the detailed information is:

Error: Error: Invalid argument calling ioctl(.., IOSSIOSPEED, -1 )

What should have happened?

I have read the source code, I think it is due to the ToBaudConstant method in bindings-cpp/src/serialport_unix.cpp. It will convert the baudrate passed by user. For baudrate higher than 230400, it will convert to -1 on MacOS.

I have also tested on windows, no such issue.

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant