How to get serial error on application layer ?

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Sep 23 12:12:11 UTC 2003


On Tue, 2003-09-23 at 13:34, Cedric Aubert wrote:
> Hi
> 
> I want to known how to have my serial communication
> error from the application layer.
> 
> I try to get error from the read() function.
> If it's return -1, I should read errno = EIO but
> how to known if it's overflow, overrun, framing or 
> parity error.
> 
> With termios, I don't found any support of this type
> of error.
> 
> Does something exist or should I do it myself ?
AFAICT, there is no standardized way to do this, because I/O is assumed
to "simply work" and "drivers to handle the nasty details" and such
errors not to be propagated/exposed to the application level nor to be
handled there.

If you really can't avoid exposing such details to the application
level, you could consider to implement corresponding ioctl's to your
driver. 

However, facing such problems in almost all cases indicate a driver bug.

Ralf






More information about the users mailing list