From 3a3febc61ebd8beb04b875402b9e801010d96417 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Mon, 11 Sep 2023 22:26:29 +0200 Subject: [PATCH] Packet - `getByte()` now tacks on the calculated first byte - `getBytes()` encodes the rquest/response code now as well --- source/doap/packet.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/doap/packet.d b/source/doap/packet.d index 182b005..c740d9f 100644 --- a/source/doap/packet.d +++ b/source/doap/packet.d @@ -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; }