Subject: [core] uint option with length zero

From: "Kovatsch Matthias" <[email-masked]>
Date: Wed, 6 Feb 2013 16:36:39 +0000

Dear list

Due to a bit of confusion on the Contiki mailing list, I wondered if it should be made explicit in core-coap that a uint value of zero SHOULD be encoded with an option length of zero. At the moment it is somewhat fuzzy with the text on leading zeros (a single zero is not really a leading zero).
Or maybe I just missed it? I would expect it in 3.2. Option Value Formats...

Ciao
Matthias

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 6 Feb 2013 22:25:39 +0100

On Feb 6, 2013, at 17:36, "Kovatsch  Matthias" <[email-masked]> wrote:

> Dear list
> 
> Due to a bit of confusion on the Contiki mailing list, I wondered if it should be made explicit in core-coap that a uint value of zero SHOULD be encoded with an option length of zero.

It never hurts to add an example.
I added:

              For example, the number 0 is represented with an
              empty option value (a zero-length sequence of bytes),
              and the number 1 by a single byte with the numerical
              value of 1 (bit combination 00000001 in most significant
              bit first notation).

I also changed "zeros" into "zero bytes" to make the term less mistakable.

In SVN as [1218].

Thanks!

Grüße, Carsten