This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: How to handle serial port input?
- To: "Jesper Skov" <jskov at cambridge dot redhat dot com>
- Subject: RE: [ECOS] How to handle serial port input?
- From: "Tom Vandeplas" <tom dot vandeplas at 4g-radio dot com>
- Date: Tue, 19 Jun 2001 18:08:42 +0200
- Cc: <ecos-discuss at sourceware dot cygnus dot com>
Ok this works great, thx for the input.
I have one additional question:
I would like to use a larger block size (len parameter) for performance
reasons. If I do so, is it possible to set a time-out on the thread.
If for a given time no input is generated on the serial port, how do I know
when to flush it.
One possibility is to configure the device to non-blocking and let it read
the data that is available, but this isn't as nice as the blocking version.
Or is this the only possible solution?
-----Original Message-----
From: jskov@thinktwice.zoftcorp.adsl.dk
[mailto:jskov@thinktwice.zoftcorp.adsl.dk]On Behalf Of Jesper Skov
Sent: dinsdag 19 juni 2001 17:34
To: Tom Vandeplas
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] How to handle serial port input?
>>>>> "Tom" == Tom Vandeplas <tom.vandeplas@4g-radio.com> writes:
Tom> If this is correct, how can I know when to read this buffer,
Tom> polling it all the time would be a disaster for performance. Is
Tom> there some way to attach an interrupt to this or even better is
Tom> there a synchrioniation primitive available?
Just launch the thread and let it read from the device. It will sleep
until there is data to be read.
Jesper