On Thu, 18 May 2000, Jean-Marie Bussat wrote:
> I would like to read data comming from two serial port as soon
> as they arrive.
> I have two devices, one connected to each port. They are sending
> data packets sequentially. E.g. device A send one packet then
> device B send its packet and so on. Packets can have any length
> going from 1 to 30 bytes.
> The serial lines have a speed of 4800 baud and packets are
> roughly sent every second.
> I would like to read packet as they are sent and I want to see
> them in the same order they were sent.
> Currently, I've written a C program which make use of "select"
> to achieve that. The problem is that it is not working in all
> conditions.
Read my 'serial_suite.tgz'. This is a collection of blurbs about the
care and feeding of the serial ports and some simple programs. There is
a file demonstrating how the lock files should be programmed. There
is a simple getty, a dialer for ppp connections and some other misc
programs.
Via ftp:
ftp scicom.alphacdc.com
Login as "anonymous" then use your full e-mail address as the password.
For me, that is '[EMAIL PROTECTED]'.
cd pub/linux
or:
URL ftp://scicom.alphacdc.com/pub/linux
In my 'serial_suite', there is a HOWTO which explains the use of
VMIN/VTIME. These should gather the data nicely, how you assemble it
in your process is up to you. Also read the '~/blurbs/locks.blurb'
about the use of lockfiles.
In my HOWTO, I recommend that 'select()' not be used on serial ports.
My rational is that 'select()' was designed to work with 'sockets()'
and the kernel overhead is greater than using the rudimentary
VMIN/VTIME technique. Does anyone have an actual comparison of these
two techniques?
verm
--
Vernon C. Hoxie [EMAIL PROTECTED]
3975 W. 29th Ave. uucp: 303-455-2670
Denver, Colo., 80212 voice: 303-477-1780
Every dog has his tree.
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to [EMAIL PROTECTED]