GaitherNews Escape the Algorithm
Today --°
Updated
Categories
DIY 1 source 0 views

A header-only message serialization library for C++17 with zero dynamic memory allocation

Article excerpt

BytePack is a header-only C++17 Arduino library for serializing plain C++ structs into compact, portable byte buffers. A message is any struct that lists its fields in a single io() member function; that one function drives serialization, deserialization and compile-time size counting, so the field list is written once and can never get out of sync. The wire format is explicit little-endian with no padding, making it safe to exchange between different architectures (ESP32, ARM, a PC on the other end of a link, etc.). All buffers are caller-provided and statically sized; there is no dynamic memory allocation. See this new open source, MIT licensed project on GitHub.