This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: short reads on serial port..




k> > Should I use select, what does it drag in the way of extra stuff to
my
> > build ... I don't want to have to add POSIX stuff really...
> > 
> > Is there another way?
> 
> Um, serial reads do block by default. If you want to wait on multiple
> devices but avoid select, you could use multiple threads using blocking
> reads, which then signal your original thread when data arrives.
>

yes but they block for the number of bytes you request .. so if I want a
max of 127 bytes they block up to 127 bytes, they can't return when they
get data.. I know I could probably could some mess with reading 1 byte and
then checking how much was left .. but I'd say it would be a bit messy ...

Dave.


 > Jifl
> 

-- 
      David Airlie, Software Engineer, Parthus Technologies plc.,
       Mary Rosse Centre, National Tech Park, Limerick, Ireland.
   t: +353-61-508116 / f: +353-61-508101 / David.Airlie@parthus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]