comp.lang.ada
 help / color / mirror / Atom feed
* Posix/serial/baud_rate issue
@ 2001-04-18  0:39 Jeetendra Manghani
  2001-04-18  8:32 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 2+ messages in thread
From: Jeetendra Manghani @ 2001-04-18  0:39 UTC (permalink / raw)


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).

Is the "Define" function overwriting the TERMINAL_CHARACTERISTICS
structure?  I'd think not since that parameter is a "in out" param.

Any ideas what I may be doing wrong?

Thanks,
Jee



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Posix/serial/baud_rate issue
  2001-04-18  0:39 Posix/serial/baud_rate issue Jeetendra Manghani
@ 2001-04-18  8:32 ` David C. Hoos, Sr.
  0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos, Sr. @ 2001-04-18  8:32 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-18  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-18  0:39 Posix/serial/baud_rate issue Jeetendra Manghani
2001-04-18  8:32 ` David C. Hoos, Sr.

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