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-Thread: 103376,b321573c2e5269d2 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: Kim Rostgaard Christensen Newsgroups: comp.lang.ada Subject: Re: Asynchronous I/O on a serial device Date: Sun, 12 Jun 2011 09:33:24 +0200 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: 2506ds1-so.0.fullrate.dk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: munin.nbi.dk 1307864007 4571 90.184.227.68 (12 Jun 2011 07:33:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sun, 12 Jun 2011 07:33:27 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9 In-Reply-To: Xref: g2news2.google.com comp.lang.ada:20740 Date: 2011-06-12T09:33:24+02:00 List-Id: On 2011-06-12 07:23, Randy Brukardt wrote: > "Kim Rostgaard Christensen" wrote in message > news:it0noa$ce3$1@munin.nbi.dk... >> Hi there >> >> I am desperately trying to implement a protocol on top of a serial >> transport. >> >> I am running Debian, and for the moment using /dev/ttyACM0 for reading. >> This works fine using standard the Text_IO package and In_File. >> Only, when I need to write to the device It fails because It is in In_File >> mode - Obviously. >> Reset on the file handle gives me a USE_ERROR exception, probably due to >> it being a special file - please correct me if I am wrong. > > Stream_IO allows changing the mode of an open stream (specifically to handle > this sort of problem). But whether that is allowed in your specific compiler > I can't say -- you'll have to experiment. > > Randy. > > I'm pretty sure I tried Stream_IO and it gave me the same result - USE_ERROR, or something similar. The problem is that it is a special file. Reset works like a charm on regular files, both in Text and Stream_IO /Kim