david icon indicating copy to clipboard operation
david copied to clipboard

David eating parameter when using cbor

Open felixletkemann opened this issue 7 years ago • 0 comments

If I transmit the following JSON over CoAP, everything works fine: [52403729, 13437171, 123456789, -1171, 3794, 4, 21212121, 1000]

If I transmit the same encoded as CBOR, the "params" variable looks like [0, 13437171, 123456789, -1171, 3794, 4, 21212121, 1000]

The first parameter seems to be lost. Switching back to non-cbor solves the problem - but I want to use cbor. The strange thing is, that all the other parameters are transmitted correctly. The problem only affects the first one. First I thought that the problem might be my cbor encoder. So I had a look into the request object. I found the following lines:

@params={"X?"=>{"52195380, 13498559, 123456789, -1171, 3794, 4, 21212121, 1000"=>nil}}>

So the correct value is transmitted - but lost somewhere. The correct value makes it into the request object but not to the params variable.

felixletkemann avatar Apr 24 '18 09:04 felixletkemann