<div dir="ltr">That sounds good to me. That being said I guess one advantage of separating the size from the data could be enable a quick way to discard the packet with minimal processing. eg if the first bytes where <div> - total size</div><div> - id size</div><div> - body size</div><div><br></div><div>you could very quickly work out if these where sane eg</div><div> - total <= max packet size</div><div> - body+id < total</div><div> </div><div>but I am not really sure I like the idea of that, I think it will make the protocol less extendible without introducing inconsistencies. </div><div><br></div><div>Jeremy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 December 2015 at 13:24, Damon Hart-Davis <span dir="ltr"><<a href="mailto:dhd@exnet.com" target="_blank">dhd@exnet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Thanks for the analysis.  Yes, all variable-length fields are immediately preceded by their length.<br>
<br>
Rgds<br>
<span class="HOEnZb"><font color="#888888"><br>
Damon<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On 29 Dec 2015, at 12:49, Jeremy Poulter <<a href="mailto:jeremy@bigjungle.net">jeremy@bigjungle.net</a>> wrote:<br>
><br>
> If I am reading it correctly you have the total packet length (including the body) as the first byte so I am OK with the body size immediately proceeding the body data and in general this should be the same format for all variable length fields (no checked this is the case in detail).<br>
><br>
> Just my 2p worth.<br>
><br>
> Jeremy<br>
><br>
> On 24 Dec 2015 10:27, "Damon Hart-Davis" <<a href="mailto:damon@opentrv.uk">damon@opentrv.uk</a>> wrote:<br>
> Hi,<br>
><br>
> <a href="http://www.earth.org.uk/OpenTRV/stds/network/20151203-DRAFT-SecureBasicFrame.txt" rel="noreferrer" target="_blank">http://www.earth.org.uk/OpenTRV/stds/network/20151203-DRAFT-SecureBasicFrame.txt</a><br>
><br>
> Matthew W suggests that parsing (etc) might be significantly easier if the body length field was moved up somewhere in front of the variable-length ID field (or if the ID length was fixed, but I’m pretty certain that I don’t want to take that path).<br>
><br>
> I’m loathe to separate the body length from the body, but I’m interested in other views on this.  Simplicity in parsing/generating is very valuable for the sorts of small systems that this protocol is aimed at.<br>
><br>
> Will Santa bring us a working protocol?  B^><br>
><br>
> Rgds<br>
><br>
> Damon<br>
<br>
_______________________________________________<br>
OpenTRV-dev mailing list<br>
<a href="mailto:OpenTRV-dev@lists.opentrv.org.uk">OpenTRV-dev@lists.opentrv.org.uk</a><br>
<a href="http://lists.opentrv.org.uk/listinfo/opentrv-dev" rel="noreferrer" target="_blank">http://lists.opentrv.org.uk/listinfo/opentrv-dev</a><br>
</div></div></blockquote></div><br></div>