# Arbitrary (i.e. nonstandard) baud rate for serial device?



## colinb (Oct 22, 2012)

I have an FTDI-based USB serial adapter that I need to run at 7812bps. How can I programmatically set a nonstandard baud rate for a serial device that supports it?

Linux has the TIOCSSERIAL ioctl, and Windows has SetCommState() -- is there a BSD equivalent?

--Colin


----------



## expl (Oct 23, 2012)

With cfsetispeed()()/cfsetospeed()() and tcsetattr()(). I believe it's POSIX defined interface so should work on big range of OSes. At least I used it when I was playing with Arduino.


----------



## colinb (Oct 23, 2012)

That works -- thanks!


----------

