(Ted Harding) wrote: snip
And, a propos of Ian's comment below:
On 14-Sep-05 Ian bell wrote:
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
The "application" I'm expecting to use is on the lines of
cat /dev/ttyS0 > datafile
or (in R, a program for statistical analysis of data)
X<-scan(file="/dev/ttyS0",n=100)
which would read 100 lines of text from /dev/ttyS0 and assign them to a 100-element vector X of character strings, and so on.
In other words, I would have a device, connected to the serial port with a serial cable, which is simply spouting a stream of data as lines of ASCII text using "4800 7S1" as RS232 serial data format. All I want to do is to capture these lines. Once read, I can do anything else I want.
It seems to me that this does make sense!
Silly me, of course it makes sense. However, I think some further thought is necessary. The serial input may well be buffered - presumably whether or not it is and by how much depends on start up parameters. Simply reading the last 100 chars from ttys0 may not get the next 100 received at the port but the last 100 in the buffer.
Ian