From: jan.de.kruyf@gmail.com
Subject: Re: file descriptor of a serial port
Date: Mon, 20 Aug 2018 08:12:40 -0700 (PDT)
Date: 2018-08-20T08:12:40-07:00 [thread overview]
Message-ID: <b14e2700-f0c1-40c2-9e09-060c6fa40eda@googlegroups.com> (raw)
In-Reply-To: <3d4bdc93-c80f-4603-adc0-fea29aa304af@googlegroups.com>
On Monday, August 20, 2018 at 4:58:27 PM UTC+2, joak...@kth.se wrote:
> Den måndag 20 augusti 2018 kl. 16:33:15 UTC+2 skrev jan.de...@gmail.com:
> > On Monday, August 20, 2018 at 4:21:20 PM UTC+2, J-P. Rosen wrote:
> > > Le 20/08/2018 à 15:56, jan.....com a écrit :
> > > > Hallo,
> > > >
> > > > I try to set up a custom baudrate on a serial port, which I believe
> > > > is done with the C ioctl procedure.
> > > >
> > > GNAT.Serial_Communications has a Set procedure to set various
> > > parameters, including baud rate. No need to play with the low level.
> > >
> > > --
> > > J-P. Rosen
> > > Adalog
> > > 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
> > > Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
> > > http://www.adalog.fr
> >
> >
> > Thanks J-P but:
> >
> > Pity, does not work.
> >
> > type Data_Rate is
> > (B75, B110, B150, B300, B600, B1200, B2400, B4800, B9600,
> > B19200, B38400, B57600, B115200);
> >
> > procedure Set
> > (Port : Serial_Port;
> > Rate : Data_Rate := B9600;
> > Bits : Data_Bits := CS8;
> > Stop_Bits : Stop_Bits_Number := One;
> > Parity : Parity_Check := None;
> > Block : Boolean := True;
> > Local : Boolean := True;
> > Flow : Flow_Control := None;
> > Timeout : Duration := 10.0);
> >
> >
> > I quit desperately need B100_000 to cure someone else's mess.
> >
> > j.
>
> Hallo Jan,
>
> You could try to copy-paste the contents of GNAT.Serial_Communications into a package of your own choice and then make changes to the code as you wish, for example adding a function that gives access to the file descriptor or adding your own enumeration value B100_000 to the Data_Rate type.
>
> Best regards,
> Joakim
Yes Joakim,
I have done that for the test harness, but I tried to keep away from it as it does not make very nice code.
Thanks,
j.
next prev parent reply other threads:[~2018-08-20 15:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 13:56 file descriptor of a serial port jan.de.kruyf
2018-08-20 14:21 ` J-P. Rosen
2018-08-20 14:33 ` jan.de.kruyf
2018-08-20 14:58 ` joakimds
2018-08-20 15:12 ` jan.de.kruyf [this message]
2018-08-20 16:36 ` Dmitry A. Kazakov
2018-08-20 19:10 ` jan.de.kruyf
2018-08-20 19:26 ` Dmitry A. Kazakov
2018-08-21 7:09 ` jan.de.kruyf
2018-08-20 15:17 ` Björn Lundin
2018-08-20 15:41 ` jan.de.kruyf
2018-08-20 19:52 ` Per Sandberg
2018-08-21 7:19 ` jan.de.kruyf
2018-08-22 7:03 ` jan.de.kruyf
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox