2007/9/13, Bachman Kharazmi <[EMAIL PROTECTED]>:
> while(counter<100){
> sem.take()
> size = rt_dev_write(fd, myString, strlen(myString));
> sem.give()
> if(size<0){
> printf(MAIN_PREFIX "3 : error %s (write), %s\n", WRITE_FILE,
> strerror(-size));
> return size;
> }
> printf("%d\n",counter);
> usleep(100000); //sleep a few millis
> counter++;
> }
> There should be solutions to with a flag or similar which can tell
> when rt_dev_write() actually is finished. Until then wait()/sleep()
> would probabily be the best solution.
>
> Are there suitable solutions where no polling is made and make me wait
> until the data have been written out to rtser0?
You want a blocking semantic.
It seems that the rt_serial config structure contains
some send timeout value.
http://www.xenomai.org/documentation/branches/v2.3.x/html/api/structrtser__config.html
which "may" be used for that purpose.
I am no xenomai rt serial expert I cannot answer precisely
about the usage of those parameters
and/or how to configure rtserial in blocking mode.
The fact is usually in realtime task you don't want to block...
So fixing an appropriate timeout for sending is usually
the user jobs since this is the only one which knows his
RT constraint.
--
Erk
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help