CoapPacket

- For delta values of 13, extract these option deltas
- Work-in-progress
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-29 08:54:08 +02:00
parent 1190199905
commit a2fff5b389
1 changed files with 22 additions and 0 deletions

View File

@ -353,6 +353,28 @@ public class CoapPacket
else if(computed == 13)
{
writeln("3333 Option delta type: 13 - DEVELOPER ADD SUPPORT! 3333");
// TODO: This is UNTESTED code!!!!
// Skip over the 4bit tuple
idx+=1;
// Delta value is 1 byte (the value found is lacking 13 so add it back)
ubyte deltaAddition = data[idx];
deltaAddition+=13;
// Update delta
delta+=deltaAddition;
// Our option ID is then calculated from the current delta
ushort optionId = delta;
// Jump over the 1 byte option delta
idx+=1;
writeln("8 bit option-id delta: ", optionId);
assert(false);
}
// 14