k5prog icon indicating copy to clipboard operation
k5prog copied to clipboard

Need one extra Line to work on macOS:

Open cyba3r opened this issue 1 year ago • 3 comments

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

cyba3r avatar Jan 12 '24 23:01 cyba3r

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

RobertoD91 avatar Mar 28 '24 16:03 RobertoD91

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. 
....

kerk1v avatar Apr 11 '24 10:04 kerk1v

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

PRNDA avatar May 23 '24 01:05 PRNDA