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

SenML (RFC 8428) sensor-measurement pack builder (DETWS_ENABLE_SENML) - zero-heap SenML-JSON and SenML-CBOR encoders over the shipped JSON / CBOR codecs. SenML is the standard measurement format for CoAP / LwM2M / HTTP telemetry. More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

SenML (RFC 8428) sensor-measurement pack builder (DETWS_ENABLE_SENML) - zero-heap SenML-JSON and SenML-CBOR encoders over the shipped JSON / CBOR codecs. SenML is the standard measurement format for CoAP / LwM2M / HTTP telemetry.

A SenML pack is an array of records. Each record carries an optional base name / base time (applied to the records that follow), a name, a unit, and exactly one value (a number, a string, or a boolean), plus an optional time:

[{"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1}]

SenML-JSON uses the text labels (bn/bt/n/u/v/vs/vb/t); SenML-CBOR uses the integer labels (n=0 u=1 v=2 vs=3 vb=4 t=6, bn=-2 bt=-3) in a CBOR map per record. Numbers that are integral are emitted as integers (so timestamps keep full precision); otherwise as floats.

The caller fills a SenmlRecord array and the builder emits the whole pack into a caller buffer (fail-closed on overflow). Verified against the RFC 8428 example.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file senml.h.