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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e490a18b9688bd9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.66.233 with SMTP id i9mr594696pbt.28.1316074786300; Thu, 15 Sep 2011 01:19:46 -0700 (PDT) Path: m9ni6673pbd.0!nntp.google.com!news1.google.com!news4.google.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Stream_Element_Array Date: Thu, 15 Sep 2011 10:20:08 +0200 Organization: cbb software GmbH Message-ID: <1esmml9qftomp.vihelaijmcar$.dlg@40tude.net> References: <1e6rw4vto3ldb.i8d7fxixapx4.dlg@40tude.net> <28u4e86fk8gn$.ialexttobgr0$.dlg@40tude.net> <276b8d0a-5b3c-4559-a275-98620657cc2f@s30g2000pri.googlegroups.com> <01c12338-e9f8-49ab-863d-c8282be3875e@g31g2000yqh.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:17974 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-09-15T10:20:08+02:00 List-Id: On Wed, 14 Sep 2011 14:29:41 -0700 (PDT), Alexander Korolev wrote: > "In your case the other end is not the memory but the wire" > I am not sure I undestand you complitly. What's wrong, at least for > now, to build \ construct in memory the Buffer (Stream_Element_Array) > with full command (according the format I posted) inside and after > that send it over any stream (including GNAT.Serial, Socket etc) > derived from Root_Stream_Type. Basicly, I don't need even a Type - > I am using it just get Unsigned_16 serialized into Stream Elements. Yes, but in most cases it does not work so straightforwardly. You usually need headers, checksums etc. The point is that you have more layers of the protocol than just raw values over stream of octets. This is why you use stream rather as a transport for packets/messages and often more upper levels too (state machine etc). The idea is to always encapsulate each level into a data type. It saves much time later. > That's it. It's kind of hadcrafting. I also can override My_Type'Write > attribute and send to Serial port ... Your approach is to create a new > stream actully, which will take into account the PROTOCOL specifics. > Absolutly agree with that. But what is wrong with manual approach I am > implementing. It is not wrong, it is just might not work because protocols are more complex (layered) than this simple model. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de