I'm trying to communicate with an RS-485 device using a USB-to-RS-485 adapter based on a CP21012N. It's capable of speeds up to 3 Mbaud. However, when I call tcsetattr()
with speed set to anything other than one of the predefined constants (using cfsetspeed()
), I get an "Invalid argument" error back from the call.
Googling, I found https://github.com/avrdudes/avrdude/issues/771
Seems like macOS really can't accept baud rates outside the predefined set without resorting to ioctl
?