comp.lang.ada
 help / color / mirror / Atom feed
* Serial Programming on the AIX
@ 2001-03-28  2:09 Jeetendra Manghani
  2001-03-28  8:46 ` David C. Hoos, Sr.
  2001-03-28 19:59 ` Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Jeetendra Manghani @ 2001-03-28  2:09 UTC (permalink / raw)


Hi there,

I had a couple questions to serial programming in ada:

1)  Can you set the baud rate?  In C, you can using tcsetattr
function.  Is there a comparable function in ada?

2)  I am coming across a problem where I use READ on the port
but it blocks until the entire buffer is filled up and then
returns, instead of returning on a CR.  Any ideas?

Thanks,
Jee Manghani



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

* Re: Serial Programming on the AIX
  2001-03-28  2:09 Serial Programming on the AIX Jeetendra Manghani
@ 2001-03-28  8:46 ` David C. Hoos, Sr.
  2001-03-28 19:59 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: David C. Hoos, Sr. @ 2001-03-28  8:46 UTC (permalink / raw)


These procedures are not part of the language-defined libraries,
but there is an Ada binding to POSIX closely conforming to that
specified in  IEEE STD  1003.5: 1990  and
IEEE STD  1003.5b: 1996.

Source code for this binding is available at:
ftp://ftp.cs.nyu.edu/pub/gnat/3.13p/florist-3.13p.tgz or
ftp://ftp.cs.nyu.edu/pub/gnat/private/old/florist/florist-3.12p-src.tar.gz

The procedures you want are in the package POSIX.Terminal_Functions.

To use these functions you will need to open the serial port with
a procedure from the package POSIX.IO, using the name of the
serial port (/dev/ttyXX ??) -- I don't know the AIX names for serial ports.

The POSIX.IO package has facilities for controlling the blocking
behavior, and other characteristics of the port.

"Jeetendra Manghani" <jmanghan@dt088n7d.san.rr.com> wrote in message
news:99rh05$4ut$1@dt088n7d.san.rr.com...
> Hi there,
>
> I had a couple questions to serial programming in ada:
>
> 1)  Can you set the baud rate?  In C, you can using tcsetattr
> function.  Is there a comparable function in ada?
>
> 2)  I am coming across a problem where I use READ on the port
> but it blocks until the entire buffer is filled up and then
> returns, instead of returning on a CR.  Any ideas?
>
> Thanks,
> Jee Manghani




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

* Re: Serial Programming on the AIX
  2001-03-28  2:09 Serial Programming on the AIX Jeetendra Manghani
  2001-03-28  8:46 ` David C. Hoos, Sr.
@ 2001-03-28 19:59 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2001-03-28 19:59 UTC (permalink / raw)


jmanghan@dt088n7d.san.rr.com (Jeetendra Manghani) writes:

> Hi there,
> 
> I had a couple questions to serial programming in ada:
> 
> 1)  Can you set the baud rate?  In C, you can using tcsetattr
> function.  Is there a comparable function in ada?

"tcsestattr" is actually provided by the operating system (AIX). The C
compiler vendor was kind enough to provide a binding of it to C. Ask
your Ada vendor to do the same, or write your own. If you have trouble
writing your own binding, post your best effort here, and maybe we can help.

> 2) I am coming across a problem where I use READ on the port but it
> blocks until the entire buffer is filled up and then returns,
> instead of returning on a CR. Any ideas?

Ask your Ada vendor about non-blocking reads on files, or about
setting buffering parameters on files.

> 
> 
> Thanks, Jee Manghani

-- 
-- Stephe



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

end of thread, other threads:[~2001-03-28 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-28  2:09 Serial Programming on the AIX Jeetendra Manghani
2001-03-28  8:46 ` David C. Hoos, Sr.
2001-03-28 19:59 ` Stephen Leake

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