comp.lang.ada
 help / color / mirror / Atom feed
From: Greg Bond <bond@ee.ubc.ca>
To: Quek Chee Kwang <engp6328@leonis.nus.sg>
Subject: Re: Reading data from the serial port using ADA on an Unix platform
Date: 1996/08/20
Date: 1996-08-20T00:00:00+00:00	[thread overview]
Message-ID: <321A308F.524C@ee.ubc.ca> (raw)
In-Reply-To: Pine.OSF.3.95.960820092821.10850A-100000@leonis.nus.sg


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




      parent reply	other threads:[~1996-08-20  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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