This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Asyn serial io
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Andre Bender <andre dot bender at gmx dot de>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 8 Jun 2007 14:29:54 +0200
- Subject: Re: [ECOS] Asyn serial io
- References: <46691664.9070304@gmx.de>
On Fri, Jun 08, 2007 at 10:42:12AM +0200, Andre Bender wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi,
>
> the online documentation leaves me slightly puzzeled when atemting to
> figure out how to set a serial port to asynchronus mode.
>
> I know I should use the cyg_io_set_config function with
> CYG_IO_SET_CONFIG_SERIAL_READ/WRITE_BLOCKING. What I can't figure out
> wether the value 1 is blocking or non blocking. (possible values are 0
> and 1 according to the online docu)
<Obi-Wan Kenobi>
Use the source Luke.
</Obi-Wan Kenobi>
case CYG_IO_SET_CONFIG_READ_BLOCKING:
if (*len < sizeof(cyg_uint32) || 0 == in_cbuf->len) {
return -EINVAL;
}
in_cbuf->blocking = (1 == *(cyg_uint32*)xbuf) ? true : false;
break;
case CYG_IO_SET_CONFIG_WRITE_BLOCKING:
if (*len < sizeof(cyg_uint32) || 0 == out_cbuf->len) {
return -EINVAL;
}
out_cbuf->blocking = (1 == *(cyg_uint32*)xbuf) ? true : false;
break;
So a value of 1 sets ->blocking to true.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss