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

Need one extra Line to work on macOS: #21

Open
cyba3r opened this issue Jan 12, 2024 · 3 comments
Open

Need one extra Line to work on macOS: #21

cyba3r opened this issue Jan 12, 2024 · 3 comments

Comments

@cyba3r
Copy link

cyba3r commented Jan 12, 2024

Hi :-)

Great work from your side!! To get this program running on Mac (Silikon) you need one extra line code. Otherwise you get an error:

"k5_receive: bad magic number" or "error 22 Invalid argument"

Function"int openport(char *port,speed_t speed)"

.....
cfmakeraw(&my_termios);
cfsetospeed(&my_termios, speed); <-Needed for MacOS
cfsetispeed(&my_termios, cfgetospeed(&my_termios));
....

Cheers
DO9JN

@RobertoD91
Copy link

Thanks, it is also needed on Intel Mac

macos version: 14.4.1 (23E224)
Xcode Version 15.3 (15E204a)
gcc version 13.2.0 (Homebrew GCC 13.2.0)

PS: only /dev/cu.usbserial-xxxx work, not the /dev/tty.usbserial-xxxx

@kerk1v
Copy link

kerk1v commented Apr 11, 2024

Hello, tried and tested. First it failed, then I compared the code.

The actual line that needs to be added is the third one:

.....
cfmakeraw(&my_termios);
cfsetospeed(&my_termios, speed); 
cfsetispeed(&my_termios, cfgetospeed(&my_termios)); <-- This is the actual line that needs to be added. 
....

@PRNDA
Copy link

PRNDA commented May 23, 2024

Hello, tried and tested. First it failed, then I compared the code.

The actual line that needs to be added is the third one:

.....
cfmakeraw(&my_termios);
cfsetospeed(&my_termios, speed); 
cfsetispeed(&my_termios, cfgetospeed(&my_termios)); <-- This is the actual line that needs to be added. 
....

Confirmed that this patch works in macOS 14.4.1

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

No branches or pull requests

4 participants