mirror of
https://github.com/deavmi/doap
synced 2024-07-07 06:10:07 +02:00
CoapPacket
- Cleared up code
This commit is contained in:
parent
6dfd908184
commit
ccda78ed6d
|
@ -441,16 +441,16 @@ public class CoapPacket
|
||||||
// Delta value is 2 bytes (BE)
|
// Delta value is 2 bytes (BE)
|
||||||
ubyte[] optionIdBytes = data[idx..idx+2];
|
ubyte[] optionIdBytes = data[idx..idx+2];
|
||||||
ushort unProcessedValue = *(cast(ushort*)optionIdBytes.ptr);
|
ushort unProcessedValue = *(cast(ushort*)optionIdBytes.ptr);
|
||||||
ushort optionId = order(unProcessedValue, Order.BE);
|
|
||||||
|
|
||||||
// The value found is then lacking 269 (so add it back)
|
// The value found is then lacking 269 (so add it back)
|
||||||
optionId+=269;
|
ushort deltaAddition = order(unProcessedValue, Order.BE);
|
||||||
|
deltaAddition+=269;
|
||||||
|
|
||||||
// Then tack on the delta
|
// Update delta
|
||||||
optionId+=delta;
|
delta+=deltaAddition;
|
||||||
|
|
||||||
// TODO: What to do about delta? I think we should make it the new delta
|
// Our option ID is then calculated from the current delta
|
||||||
delta=optionId;
|
ushort optionId = delta;
|
||||||
|
|
||||||
// Jump over [Option delta extended (16bit)] here
|
// Jump over [Option delta extended (16bit)] here
|
||||||
idx+=2;
|
idx+=2;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user