(Ted Harding) wrote:
Hi Folks,
Advice on an ancient ritual please ...
Suppose I want to set the serial port parameters of /dev/ttyS0, e.g.
Speed = 4800 baud, 7 data bits, Space parity, 1 stop bit
aka "4800 7S1".
I don't seem to find a Linux utility wich will do this simply.
I've been doing it by starting up minicom, going into its "config" mode via "^A-Z", doing each of these bitty things separately, and then quitting. However, this is manifestly overkill! (Not to say clumsy, time-consuming, and not suited for incorporation in a script).
Of course, once done once, one can save the resulting config to a minirc.* file and then run 'minicom minirc.whatever', which does the business but still leaves minicom running so it has to be killed (since it's stealing data from the serial port), and there's no option I can see to minicom which tells it to "run setup and quit".
What I'm really after is a simple utility on the lines of
serialpars -s 4800 -b 7 -p S -s 1 /dev/ttyS0
to set up "4800 7S1", but I can't find such a thing. (setserial doesn't seem to do this -- while it's in principle possible to set the baud rate in a roundabout way, I don't see any provision for data bits, parity, stop bits.)
Any ideas?
Thanks, best wishes, and good morning!
Ted.
I think what you want to do does not make sense. It is the responsibility of the application using the serial port to set its parameters. There is no 'global' setting. That's why minicon can config them. What application are you expecting to use once you have run your serialpars util?
Ian