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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder3.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!85.12.16.68.MISMATCH!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx44.am4.POSTED!not-for-mail Subject: Re: file descriptor of a serial port Newsgroups: comp.lang.ada References: From: Per Sandberg User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Message-ID: <_ZEeD.60176$4w.12143@fx44.am4> X-Complaints-To: abuse@usenet.se NNTP-Posting-Date: Mon, 20 Aug 2018 19:52:26 UTC Organization: usenet.se Date: Mon, 20 Aug 2018 21:52:26 +0200 X-Received-Bytes: 2788 X-Received-Body-CRC: 564155374 Xref: reader02.eternal-september.org comp.lang.ada:54196 Date: 2018-08-20T21:52:26+02:00 List-Id: Why don't patch your own "GNAT.Serial_Communications" and put in your own projects sources. -------------------------------------------------------------------- package GNAT.Serial_Communications is ... type Data_Rate is (B75, B110, B150, B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B100000, B115200); ... private ... Data_Rate_Value : constant array (Data_Rate) of Interfaces.C.unsigned ... B57600 => 57_600, B100000 => 100_000, B115200 => 115_200); end GNAT.Serial_Communications; -------------------------------------------------------------------- package body GNAT.Serial_Communications is ... C_Data_Rate : constant array (Data_Rate) of unsigned := ... B57600 => OSC.B57600, B100000 => 0010010, --< OSC.B115200); ... end GNAT.Serial_Communications; -------------------------------------------------------------------- project Serial_Mess is for Source_Dirs use ("src"); for Object_Dir use ".obj"; for Main use ("main.adb"); package Compiler is for Switches ("g-sercom.adb") use ("-gnatg"); end Compiler; end Serial_Mess; -------------------------------------------------------------------- And you are done. Did the same thing some years ago for B75 before it was implemented in the distributed Run-times. /P On 08/20/18 15:56, jan.de.kruyf@gmail.com wrote: > Hallo, > > I try to set up a custom baudrate on a serial port, which I believe is done with the C ioctl procedure. > > However, for that I need the fd of the serial port which is hidden in the private part of GNAT.Serial_Communications. > > I tried to construct a child package of GNAT.Serial_Communications but the compiler does not like that, since it does not actually compile that package. > > Has anybody any idea? > > Thanks, > > Jan de Kruijf. >