nning / david

CoAP server with Rack interface.
MIT License
37 stars 11 forks source link

David eating parameter when using cbor #15

Open felixletkemann opened 6 years ago

felixletkemann commented 6 years ago

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.