From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,120d3fa8b30138be X-Google-Attributes: gid103376,public From: Greg Bond Subject: Re: Reading data from the serial port using ADA on an Unix platform Date: 1996/08/20 Message-ID: <321A308F.524C@ee.ubc.ca>#1/1 X-Deja-AN: 175956841 references: to: Quek Chee Kwang content-type: text/plain; charset=us-ascii organization: Dept. of Electrical Eng., UBC mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.02 (Macintosh; I; PPC) Date: 1996-08-20T00:00:00+00:00 List-Id: 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