erlang-serial icon indicating copy to clipboard operation
erlang-serial copied to clipboard

Why is max speed hardcoded as 230400?

Open Shnatsel opened this issue 10 years ago • 2 comments

Looking at https://github.com/tonyg/erlang-serial/blob/master/c_src/serial.c#L88 maximum speed is hard-coded as 230400 baud, but there's no explanation given for said cap.

We might need speeds up to 460800 baud in the current project, so I wonder if there is a reason for the current speed limit?

Shnatsel avatar Nov 28 '15 21:11 Shnatsel

There is no reason other than "historical reasons" for the cap. A patch to add additional speeds would be welcome. (It's a shame the relevant ioctls don't permit easy mapping from a number to an ioctl constant, otherwise we could accept arbitrary speeds...)

tonyg avatar Nov 29 '15 19:11 tonyg

Thanks for the pointer! I've found the same hardcoded constants in termios manpage so that's where the limitation seems to come from. I'll see if I find a way to set arbitrary speeds on modern systems.

Shnatsel avatar Nov 29 '15 19:11 Shnatsel