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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,19ff5e2b428c1797 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-18 01:32:02 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!hub1.nntpserver.com!news-in.nibble.net!telocity-west!TELOCITY!newsrump.sjc.telocity.net!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada References: <9bik19$6m8$1@dt088n7d.san.rr.com> Subject: Re: Posix/serial/baud_rate issue MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <6icD6.17238$63.6198375@newsrump.sjc.telocity.net> X-Trace: NTBDTm9BdYVoVXNlciAiRUxPQ0lUWS1SRUFERVJTIDIxNk0yMjcuxTcuNDkgICFlZCwgMTggQXBy!IDIwMDEgMDE6UDI6MDLRUERU X-Abuse-Info: Please forward ALL headers when reporting abuse. X-Complaints-To: abuse@telocity.net NNTP-Posting-Date: Wed, 18 Apr 2001 01:32:02 PDT Date: Wed, 18 Apr 2001 03:32:50 -0500 Xref: supernews.google.com comp.lang.ada:6965 Date: 2001-04-18T03:32:50-05:00 List-Id: You specified neither the operating system, nor the Ada compiler, nor the POSIX binding you're using, so it's hard to be precise in answering your questions. I'm assuming the OS is Linux on ix86, the GNAT compiler, version 3.12 or later, and the florist binding corresponding to the gnat compiler versions. I'm further assuming a GNAT/florist distribution from The Ada for Linux Team (http://www.gnuada.org/rpms.html) "Jeetendra Manghani" wrote in message news:9bik19$6m8$1@dt088n7d.san.rr.com... > Hello, > > I posted a while back about ada packages that aid in serial > programming. Someone showed me some packages, POSIX_IO, and > POSIX_TERMINAL_FUNCTIONS. > > Well, now I get an error when trying to set the baud rate for > some reason. > > I open a port and then "Get_terminal_characteristics", use > "Define_Input_Baud_Rate" with POSIX_TERMINAL_FUNCTIONS.B38400 > as the baud_rate, and then do a "Set_Terminal_Characteristics". > > This gives me an error 22, which is EINVAL (Invalid_Argument). Have you tried a lower baud rate? Is it possible that your hardware/OS combination does not support 38400? > > Is the "Define" function overwriting the TERMINAL_CHARACTERISTICS > structure? I'd think not since that parameter is a "in out" param. > Yes, the Define function alters the Terminal_Characteristics object -- that's why "out" is one of the parameter modes. In order to see whether the other values of the Terminal_Characteristics object are reasonable, you could use the functions XXX_Of (Characteristics : Terminal_Characteristics) return YYY; and print them out. I have used these bindings for several years with great success. > Any ideas what I may be doing wrong? > > Thanks, > Jee