Dave Pfaltzgraff@PATAPSCO
05/18/2000 08:21 AM

Jean-Marie Bussat asked for help:

>I would like to read data comming from two serial port as soon
>as they arrive.

---8< snip

data from device A   |   data from device B
--------------------------------------------
<packet 1A>          |                       \
                     | <packet 1B>            |what I expect and
<packet 2A>          |                        |would like to see
                     | <packet 2B>           /

============================================

<begining of         |                       \
packet 1A>           |                        |
                     | <packet 1B>            |
<end of 1A +         |                        |what I'm getting
begining of 2A>      |                        |
                     | <begining of 2B>       |
<end of 2A>          |                        |
                     | <end of 2B>           /

----8< /snip

The first thing that comes to mind is what do the packets look
like? Specifically, how do you know when the end has arrived? If
it is a <CR>, a <LF> or both, you can use the 'cooked' method
and have the select wait until the end is known. If not, then your
program needs to do a little buffering for you. The select call
has a timeout feature which may help you, but many times the time-
out can get in the way.

With the parameters you gave, a message may take as long as
62.5 msec to arrive. This is a long time in terms of program execution.
You mention that the packets should arrive alternately. Is there
some event that will synchronise the two senders?

In order to understand your problem further, we would need to see
what the protocol looks like and the snippet of code that includes
the select call.



-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to [EMAIL PROTECTED]

Reply via email to