comp.lang.ada
 help / color / mirror / Atom feed
* Re: Reading data from the serial port using ADA on an Unix platform
  1996-08-20  0:00 Reading data from the serial port using ADA on an Unix platform Quek Chee Kwang
@ 1996-08-20  0:00 ` Darel Cullen
  1996-08-26  0:00   ` Jim Dorman
  1996-08-20  0:00 ` Greg Bond
  1 sibling, 1 reply; 4+ messages in thread
From: Darel Cullen @ 1996-08-20  0:00 UTC (permalink / raw)



In article <Pine.OSF.3.95.960820092821.10850A-100000@leonis.nus.sg>,
Quek Chee Kwang <engp6328@leonis.nus.sg> writes
>Greetings.
>
>I'm new to ADA and I would like to know how to program in ADA to read data
>(binary & ascii) coming from the serial port (for instance, a modem) on an
>Unix platform.
>
>Thank you very much.
>
>Quek
>
>

Firstly Investigate your compilers pragma INTERFACE features. what you
will need to do is build up a set of ADA functions and procedures that
are directly bound to the C calls, in unix's case I think ioctl() would
be a good place to start.
basically , ADA has no features with which to read from a serial port,
you'll have to use the C calls and bind them to ADA.


-- 
Darel Cullen




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

* Re: Reading data from the serial port using ADA on an Unix platform
  1996-08-20  0:00 Reading data from the serial port using ADA on an Unix platform Quek Chee Kwang
  1996-08-20  0:00 ` Darel Cullen
@ 1996-08-20  0:00 ` Greg Bond
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Bond @ 1996-08-20  0:00 UTC (permalink / raw)
  To: Quek Chee Kwang


Quek Chee Kwang wrote:
> 
> Greetings.
> 
> I'm new to ADA and I would like to know how to program in ADA to read data
> (binary & ascii) coming from the serial port (for instance, a modem) on an
> Unix platform.

Quek,

You should be able to directly read from and write to the appropriate 
/dev/tty* file using Ada's stream I/O. However, if you want to configure the 
port parameters then you will have to access the ioctl() system call via 
Ada's C lanaguage interface. If you want interrupt driven I/O you might be 
able to use GNAT's interrupt support, depending on which Unix platform you 
are using. I've never done any of these things myself but this is how I would 
start to approach the problem.

Greg.

--
* Greg Bond                         * Dept. of Electrical Eng.  
* email: bond@ee.ubc.ca             * Univ. of British Columbia      
* voice: (604) 822 0899             * 2356 Main Mall                 
* fax:   (604) 822 5949             * Vancouver, BC              
* web: http://www.ee.ubc.ca/~bond   * Canada, V6T 1Z4




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

* Reading data from the serial port using ADA on an Unix platform
@ 1996-08-20  0:00 Quek Chee Kwang
  1996-08-20  0:00 ` Darel Cullen
  1996-08-20  0:00 ` Greg Bond
  0 siblings, 2 replies; 4+ messages in thread
From: Quek Chee Kwang @ 1996-08-20  0:00 UTC (permalink / raw)



Greetings.

I'm new to ADA and I would like to know how to program in ADA to read data
(binary & ascii) coming from the serial port (for instance, a modem) on an
Unix platform.

Thank you very much.

Quek






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

* Re: Reading data from the serial port using ADA on an Unix platform
  1996-08-20  0:00 ` Darel Cullen
@ 1996-08-26  0:00   ` Jim Dorman
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Dorman @ 1996-08-26  0:00 UTC (permalink / raw)



It's not necessary to use any Pragmas to use RS232.  IntegrAda and the
AdaUser libraries for ActivAda contain an RS232 library.  Don't make your
job any harder than it needs to be!  Use the right tools for the job.

Why not stop by the Home of PCAda and check out your toolchest!  You can
visit us at "http://www.pcada.com."

-- 
Jim Dorman
Active Engineering Technologies, Inc.
Home of PC ADA
Voice:  (619) 414-9001
Fax:     (619) 414-9192
email:  jimd@pcada.com
URL:  http://www.pcada.com
Member of Team Ada!

Darel Cullen <Darel@djcull.demon.co.uk> wrote in article
<JDwxYGAJJjGyEwQO@djcull.demon.co.uk>...
> In article <Pine.OSF.3.95.960820092821.10850A-100000@leonis.nus.sg>,
> Quek Chee Kwang <engp6328@leonis.nus.sg> writes
> >Greetings.
> >
> >I'm new to ADA and I would like to know how to program in ADA to read
data
> >(binary & ascii) coming from the serial port (for instance, a modem) on
an
> >Unix platform.
> >
> >Thank you very much.
> >
> >Quek
> >
> >
> 
> Firstly Investigate your compilers pragma INTERFACE features. what you
> will need to do is build up a set of ADA functions and procedures that
> are directly bound to the C calls, in unix's case I think ioctl() would
> be a good place to start.
> basically , ADA has no features with which to read from a serial port,
> you'll have to use the C calls and bind them to ADA.
> 
> 
> -- 
> Darel Cullen
> 




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

end of thread, other threads:[~1996-08-26  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-20  0:00 Reading data from the serial port using ADA on an Unix platform Quek Chee Kwang
1996-08-20  0:00 ` Darel Cullen
1996-08-26  0:00   ` Jim Dorman
1996-08-20  0:00 ` Greg Bond

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