On 14-Sep-05 Ian bell wrote:
(Ted Harding) wrote:
[...] 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
You're right, of course, about that sort of thing. It depends on how the external device is sending data.
In the case of a monitoring instrument, for example, it may send a burst of maybe 100 chars of data once a second. This is not going to cause problems at speeds comfortably above 1000 baud, since this gives plenty of time for the program reading the data to pick it off char by char, thereby clearing the internal UART buffer in time for the next char.
If, however, the external device is transmitting more or less continuously at an information rate close to the baud rate, then the opportunities for pile-ups, buffer overflows, and data loss accumulate! In that case one would have to ensure that flow control was carefully set up at both ends.
Thanks! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 14-Sep-05 Time: 14:07:24 ------------------------------ XFMail ------------------------------