ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
cbor.h File Reference

Layer 6 (Presentation) - zero-heap CBOR (RFC 8949) encoder. More...

#include "spatium/spatium.h"
#include "network_drivers/presentation/codec/codec.h"
#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Layer 6 (Presentation) - zero-heap CBOR (RFC 8949) encoder.

A streaming encoder that writes directly into a caller-provided buffer (no heap), the binary counterpart to the JSON writer. Emit definite-length arrays and maps by writing the header (Cbor.put_array / Cbor.put_map with the item count) then that many items (twice that for a map: key, value, key, value, ...).

Overflow is tracked, not crashed on: writes past the buffer set the overflow flag and stop, while the span's pos keeps counting the bytes the full payload would need, so a caller can size the buffer and check spat.ok().

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file cbor.h.