EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  2025  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: Re: Size encoding
From: Ralph Lange <[email protected]>
To: EPICS Core Talk <[email protected]>
Date: Tue, 15 May 2018 15:46:38 +0200
Hi Bruno,

I agree that the C++ implementation seemingly uses -1 in the first byte to encode "empty" and -2 to encode "string of size >= 2^8-2".
Houston, we have a problem.

(The value you are missing in the third case of the spec is explicitly mentioned there as 2^31-1.)

Cheers,
~Ralph


On Tue, May 15, 2018 at 3:13 PM Bruno Martins <[email protected]> wrote:
Hi,

I was taking a look at how messages are de/serialized by pvData and pvAccess and I think there is an inconsistency between the spec and the implementation regarding how sizes are encoded.

The spec says, basically [1]:

If size < 2^8-1, encode byte directly
If size < 2^31-1, encode -1 as byte and then size as signed 32-bit integer
If size < 2^63-1, encode -1 as byte, then a positive 32-bit int (which value? -1?), then size as a signed 64-bit integer.

The implementation (C++) does [2]:

If size == -1, encode -1 as byte (what is this used for?)
If size < 2^8 - 2, encode size directly as byte
Else encode -2 as byte, size as signed 32-bit integer

Replies:
Re: Size encoding Benjamin Franksen
References:
Size encoding Bruno Martins

Navigate by Date:
Prev: Size encoding Bruno Martins
Next: random half finished features Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  2025 
Navigate by Thread:
Prev: Size encoding Bruno Martins
Next: Re: Size encoding Benjamin Franksen
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  2025 
ANJ, 16 May 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·