This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Can't read with cyg_io_read()
Return-Path: <gentleman.nbg@gmx.de>
X-Original-To: grante@shell.visi.com
Delivered-To: grante@shell.visi.com
Received: from g2host.com (mailback1.g2host.com [208.42.176.222])
by baal.visi.com (Postfix) with ESMTP id DFF0865101
for <grante@shell.visi.com>; Fri, 15 Feb 2008 02:22:24 -0600 (CST)
Received: from <grante@visi.com>
by mailback1.g2host.com (CommuniGate Pro RULES 5.1.14)
with RULES id 8550970; Fri, 15 Feb 2008 02:22:11 -0600
X-Autogenerated: Mirror
Resent-From: <grante@visi.com>
Resent-Date: Fri, 15 Feb 2008 02:22:11 -0600
Received: from spamfilter-21.visi.com ([208.42.184.21] verified)
by mailfront1.g2host.com (CommuniGate Pro SMTP 5.1.14)
with ESMTP id 37653588 for grante@visi.com; Fri, 15 Feb 2008 02:22:12 -0600
Received: from mail.gmx.net <gentleman.nbg@gmx.de> ([213.165.64.20]) by spamfilter-21.visi.com; Fri, 15 Feb 2008 02:22:22 -0600
X-RC-HOST: spamfilter-21.visi.com
X-RC-DBID: 046c9cac-dc1e-47d7-acbb-d595ac2651b6
X-RC-ID: 20080215082222709
X-RC-IP: 213.165.64.20
X-RC-FROM: <gentleman.nbg@gmx.de>
X-RC-RCPT: <grante@visi.com>
Received: (qmail 22455 invoked by uid 0); 15 Feb 2008 08:22:17 -0000
Received: from 212.114.211.6 by www106.gmx.net with HTTP;
Fri, 15 Feb 2008 09:22:17 +0100 (CET)
Content-Type: text/plain; charset="iso-8859-1"
Date: Fri, 15 Feb 2008 09:22:17 +0100
From: Gentleman.nbg@gmx.de
In-Reply-To: <fp2i3i$3r0$1@ger.gmane.org>
Message-ID: <20080215082217.261290@gmx.net>
MIME-Version: 1.0
References: <20080214142959.285270@gmx.net> <20080214223117.258120@gmx.net>
<fp2g2b$tqf$1@ger.gmane.org> <20080214231112.62940@gmx.net>
<fp2i3i$3r0$1@ger.gmane.org>
To: Grant Edwards <grante@visi.com>
X-Authenticated: #15759101
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX18jX5d1rI0j9ycPuJnrxSD9j/gj1KixflUQnidqUx
V3dNNiKeTYyY/0cp14Gs93+2f1k0i0d5b2SQ==
Content-Transfer-Encoding: 8bit
X-GMX-UID: i3KGfyRSMmA6TJYam2FnKnE5MjQ1Nx0x
Resent-Message-Id: <20080215082224.DFF0865101@baal.visi.com>
X-Seen-By-Grants-Procmail-Script: YES
Subject: Re: Can't read with cyg_io_read()
>Thank you for this hint.
>
>One last question:
I doubt it.
>I would like to set the configuration of my serial port to:
>115200 baud, 1 stop-bit, no partity, word = 8bit;
>
>I am tring it like this but cyg_io_lookup() returns a error, do
>you know if my api syntax is correct?:
>
>cyg_serial_info_t dcb = { CYGNUM_SERIAL_BAUD_115200, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, 8, 0 };
>
>cyg_uint32 dcb_len = sizeof(dcb);
FWIW, I don't like the parens around dcb. It makes it look
like sizeof is a function or macro instead of an operator.
>err = cyg_io_lookup( "/dev/haldiag" /*"/dev/tty0"*/ , &handle );
That looks OK to me.
> if(ENOERR == err)
> err = cyg_io_set_config(handle, CYG_IO_SET_CONFIG_SERIAL_INFO, &dcb, &dcb_len);
That doesn't look OK. I always thought that hal diag drivers
ran at a fixed baud and configuration. But I wasn't sure. Do
you know what I just did? I _looked_at_the_source_ :
Here's code from io/serial/current/src/common/haldiag.c:
126 static Cyg_ErrNo
127 haldiag_set_config(serial_channel *chan, cyg_uint32 key, const void *xbuf,
128 cyg_uint32 *len)
129 {
130 switch (key) {
131 case CYG_IO_SET_CONFIG_SERIAL_INFO:
132 diag_printf("%s\n", __FUNCTION__);
133 return ENOERR;
134 default:
135 return -EINVAL;
136 }
137 }
138 #endif // CYGPKG_IO_SERIAL_HALDIAG
--
Grant Edwards grante Yow! I'm continually AMAZED
at at th'breathtaking effects
visi.com of WIND EROSION!!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss