- `getByte()` now tacks on the calculated first byte
- `getBytes()` encodes the rquest/response code now as well
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-11 22:26:29 +02:00
parent d6a9f7d329
commit 3a3febc61e

View File

@ -29,7 +29,11 @@ public class CoapPacket
ubyte firstByte = cast(ubyte)(ver << 6);
firstByte = firstByte | cast(ubyte)(type << 4);
firstByte = firstByte | tokenLen;
encoded ~= firstByte;
// Set the request/response code
encoded ~= code;
return encoded;
}