comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Posix/serial/baud_rate issue
Date: Wed, 18 Apr 2001 03:32:50 -0500
Date: 2001-04-18T03:32:50-05:00	[thread overview]
Message-ID: <6icD6.17238$63.6198375@newsrump.sjc.telocity.net> (raw)
In-Reply-To: 9bik19$6m8$1@dt088n7d.san.rr.com

You specified neither the operating system, nor the Ada compiler,
nor the POSIX binding you're using, so it's hard to be precise in
answering your questions.

I'm assuming the OS is Linux on ix86, the GNAT compiler,
version 3.12 or later, and the florist binding corresponding
to the gnat compiler versions.

I'm further assuming a GNAT/florist distribution from
The Ada for Linux Team (http://www.gnuada.org/rpms.html)

"Jeetendra Manghani" <jmanghan@dt088n7d.san.rr.com> wrote in message
news:9bik19$6m8$1@dt088n7d.san.rr.com...
> Hello,
>
> I posted a while back about ada packages that aid in serial
> programming.  Someone showed me some packages, POSIX_IO, and
> POSIX_TERMINAL_FUNCTIONS.
>
> Well, now I get an error when trying to set the baud rate for
> some reason.
>
> I open a port and then "Get_terminal_characteristics", use
> "Define_Input_Baud_Rate" with POSIX_TERMINAL_FUNCTIONS.B38400
> as the baud_rate, and then do a "Set_Terminal_Characteristics".
>
> This gives me an error 22, which is EINVAL (Invalid_Argument).
Have you tried a lower baud rate?  Is it possible that your hardware/OS
combination does not support 38400?

>
> Is the "Define" function overwriting the TERMINAL_CHARACTERISTICS
> structure?  I'd think not since that parameter is a "in out" param.
>
Yes, the Define function alters the Terminal_Characteristics object --
that's
why "out" is one of the parameter modes.

In order to see whether the other values of the Terminal_Characteristics
object are reasonable, you could use the functions
XXX_Of (Characteristics : Terminal_Characteristics) return YYY;
and print them out.

I have used these bindings for several years with great success.

> Any ideas what I may be doing wrong?
>
> Thanks,
> Jee




      reply	other threads:[~2001-04-18  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-18  0:39 Posix/serial/baud_rate issue Jeetendra Manghani
2001-04-18  8:32 ` David C. Hoos, Sr. [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox