Messages in this thread | | | Date | Wed, 27 Aug 2003 13:17:15 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: Reading accurate size of recepts from serial port |
| |
On Wed, 27 Aug 2003, Laurent [iso-8859-1] Hugé wrote:
> Le Mercredi 27 Août 2003 16:50, Herbert Pötzl a écrit : > > hmm, why not do simple framing ... > > [length]<data>[length]<data> .... > That's impossible. CCSDS is the committee for space date systems and it > provides standards that I can't overrule (even if I can't really understand > why they've done it like that !). > -- > Laurent Hugé. >
The transfer frame in your reference specified, contains all the information necessary for the protocol, even if it's stupid to use that protocol on a RS-232C link. Nevertheless, there is a minimim size for the header (5 octets in length). There is also the 3 octets used for sync, which I'm pretty sure will not be put onto the RS-232C links. Anyway, you need to read 40 bytes (always), from that, you will learn the length of the rest of the data. So you use poll()/read() until you get that header information. Then you will know what the total read-length should be.
Cheers, Dick Johnson Penguin : Linux version 2.4.22 on an i686 machine (794.73 BogoMips). Note 96.31% of all statistics are fiction.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |