Skip to contentSkip to conversation

error after timeout on serial port

Xenomai-help Nicolas BLANCHARD 1 participant 1 message Feb 23, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Jan Kiszka <[email protected]> 23.02 15:51 >>>

Quoted 3 lines · Lauener Nathan

Hi,

I am polling on a serial port during an init sequence of a

positioning

Quoted 2 lines
Quoted 2 lines

device. Every once in a while I get a return code indicating that a timeout occured, code -110 (ETIMEDOUT).

In the struct rtser_config you have the event_timeout parameter that cause
ETIMEDOUT (if it's different than RTSER_DEF_TIMEOUT).
Have a look on rt_dev_ioctl(uiFd, RTSER_RTIOC_WAIT_EVENT, &rx_event ).

Quoted 2 lines

After a timeout occured I can't

Quoted 1 line

read the port anymore. Whenever I call rt_dev_read() again the

function

Quoted 1 line
Quoted 1 line

returns the error code -14 (EFAULT). Is there a flag I must clear to

get

Quoted 1 line
Quoted 1 line

the port operatioanl again?

Is your device correctly open (file descriptor>=0) ?

Quoted 2 lines

I /tend/ to say it's an application bug, because we are using the

driver

Quoted 8 lines

heavily, and our sluggish devices often cause timeouts during setup. Some colleague should have already slapped me otherwise. :)

Are you sure that a valid buffer and a valid size is passed to rt_dev_read after the timeout (because those should be the reason for EFAULT)? If yes, maybe you can post a simple demo for the effect.

Jan

Blanchard nicolas