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,FREEMAIL_FROM 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,UTF8 Path: g2news2.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!news2.euro.net!xlned.com!feeder3.xlned.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Asynchronous I/O on a serial device Date: Sun, 12 Jun 2011 07:42:44 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: f5R0gSm2zBSnDCiIl1SGIw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.11 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:20738 Date: 2011-06-12T07:42:44+02:00 List-Id: Le Sat, 11 Jun 2011 23:46:47 +0200, Kim Rostgaard Christensen = a =C3=A9crit: > 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) besid= e = 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 som= e = > way I can do bi-directional communication like, for instance two file = = > handles. (I tried Form =3D> "shared=3Dyes", 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 byt= es = or characters (well, a file of the more atomic type your protocol define= s). [*] If something is missing we do not know, tell us. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem] =E2=80=9Cc++; /* this makes c bigger but returns the old value */=E2=80=9D= [Anonymous]