From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Asynchronous I/O on a serial device
Date: Sun, 12 Jun 2011 07:42:44 +0200
Date: 2011-06-12T07:42:44+02:00 [thread overview]
Message-ID: <op.vwx7hiikule2fv@douda-yannick> (raw)
In-Reply-To: it0noa$ce3$1@munin.nbi.dk
Le Sat, 11 Jun 2011 23:46:47 +0200, Kim Rostgaard Christensen
<krc@retrospekt.dk> a écrit:
> Hi there
Hi you :)
> 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
Not good in my opinion (see later)
> 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.
I do not know about your device node, so I could not say if its writable
or not, but note you also have Inout_File in Ada (do not know what it
named Inout_File instead of In_Out_File, but that's another story) beside
of In_File, so could perfectly have input and output on the file.
> Do I need to implement this more system-near/specific, or is there some
> way I can do bi-directional communication like, for instance two file
> handles. (I tried Form => "shared=yes", and it also failed).
I would not say more system specific, but rather more close to some
implicit specifications here: I am not sure you have good reasons [*] to
use Text_IO, and you may better have a file of some basic type, like bytes
or characters (well, a file of the more atomic type your protocol defines).
[*] If something is missing we do not know, tell us.
--
“Syntactic sugar causes cancer of the semi-colons.” [Epigrams on
Programming — Alan J. — P. Yale University]
“Structured Programming supports the law of the excluded muddle.” [Idem]
“c++; /* this makes c bigger but returns the old value */” [Anonymous]
next prev parent reply other threads:[~2011-06-12 5:42 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
2011-06-12 5:42 ` Yannick Duchêne (Hibou57) [this message]
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