DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
lwm2m_tlv.h File Reference

OMA LwM2M TLV codec (DETWS_ENABLE_LWM2M) - zero-heap writer + cursor reader for the application/vnd.oma.lwm2m+tlv resource encoding, carried over the shipped CoAP service for LwM2M device management. More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

OMA LwM2M TLV codec (DETWS_ENABLE_LWM2M) - zero-heap writer + cursor reader for the application/vnd.oma.lwm2m+tlv resource encoding, carried over the shipped CoAP service for LwM2M device management.

Each TLV is Type(1) Identifier(1-2) Length(0-3) Value(n):

  • Type bits 7-6: identifier kind - 00 Object Instance, 01 Resource Instance, 10 Multiple Resource, 11 Resource with Value.
  • Type bit 5: identifier width (0 = 8-bit, 1 = 16-bit).
  • Type bits 4-3: length kind - 00 inline in bits 2-0, 01 = 8-bit, 10 = 16-bit, 11 = 24-bit.
  • Type bits 2-0: the value length when the length kind is inline (0..7). Identifiers and lengths are big-endian. Resource values are big-endian: integers are the shortest of 1/2/4/8 octets (two's complement), booleans one octet, strings UTF-8.

The writer emits TLVs into a caller buffer (fail-closed on overflow); the reader is a cursor that decodes one TLV at the buffer head. Type-byte layout verified against the OMA LwM2M spec.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file lwm2m_tlv.h.