Closed HStangl closed 7 years ago
@jacobsa Any news on this ?
I actually have the same issue. I'm using a "virtual" serial port created with socat
.
If I comment these lines:
if errno2 != 0 {
return nil, os.NewSyscallError("SYS_IOCTL", errno2)
}
if r2 != 0 {
return nil, errors.New("Unknown error from SYS_IOCTL.")
}
The error is ignored and the device works as expected. I assume this is because socat's virtual socket doesn't support the kIOSSIOSPEED
IOCTL on OSX.
From the issues log, I can see this was introduced as #7.
For the record, here is the socat command line I used:
socat -d -d -d pty,raw,link=$HOME/dev/ttyS0 tcp:192.168.0.3:3002
I would be willing to make a PR for that, but I'm not sure which way is best:
Thank you for the good work.
Thanks for the details. Are you able to reliably detect "this isn't a thing that is supported by this virtual socket"? I.e. does it return something like ENOSYS
? If so, maybe ignore that?
@jacobsa Sorry it took me so long to answer. I got caught up in many things at work and this basically used all of my free-time.
I came up with a PR (#25) that solves this issue. Let me know what you think and if I need to make some changes. I obviously tested it on OSX and I can confirm it works (at least on my machine ;)).
Thanks again for the good work !
P.S : I notice you don't have Continuous Integration enabled. If that is something you are interested in, I can help in that regard too. Just let me know.
Thanks very much; please do feel free to set up CI if you like.
@jacobsa You may want to close this issue too :)
When trying the sample code with Mac OS 10.10, I get the following error: serial.Open: SYS_IOCTL: invalid argument
Some digging around showed that the call to setTermios() in open_darwin.go fails.
I'm using a Delock USB to Serial adapter with FTDI chipset.