comp.lang.ada
 help / color / mirror / Atom feed
From: Kim Rostgaard Christensen <krc@retrospekt.dk>
Subject: Re: Asynchronous I/O on a serial device
Date: Sun, 12 Jun 2011 09:33:24 +0200
Date: 2011-06-12T09:33:24+02:00	[thread overview]
Message-ID: <it1q46$4er$1@munin.nbi.dk> (raw)
In-Reply-To: <it1ih3$vsu$1@munin.nbi.dk>

On 2011-06-12 07:23, Randy Brukardt wrote:
> "Kim Rostgaard Christensen"<krc@retrospekt.dk>  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



  reply	other threads:[~2011-06-12  7:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-11 21:46 Asynchronous I/O on a serial device Kim Rostgaard Christensen
2011-06-12  5:23 ` Randy Brukardt
2011-06-12  7:33   ` Kim Rostgaard Christensen [this message]
2011-06-12  5:42 ` Yannick Duchêne (Hibou57)
2011-06-12  7:49   ` Kim Rostgaard Christensen
2011-06-12 10:35     ` Kim Rostgaard Christensen
2011-06-12 11:04     ` Yannick Duchêne (Hibou57)
2011-06-12 18:06       ` Kim Rostgaard Christensen
2011-06-12 21:01 ` anon
2011-06-14  6:37   ` Kim Rostgaard Christensen
2011-06-15 17:02     ` Simon Clubley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox