|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Wired M-Bus (Meter-Bus, EN 13757-2/-3) frame codec (PC_ENABLE_MBUS). More...
#include "protocore_config.h"Go to the source code of this file.
Wired M-Bus (Meter-Bus, EN 13757-2/-3) frame codec (PC_ENABLE_MBUS).
A pure, zero-heap builder + parser for the M-Bus link-layer frames used by utility meters (water / gas / heat / electricity), plus a walker for the EN 13757-3 variable-data records (DIF / VIF). M-Bus has three frame formats:
The control frame is just a long frame with no user data (L = 3). The checksum is the 8-bit sum of every octet from C through the end of the user data.
The wired bus is a powered two-wire pair: the ESP32 talks to it over a UART through an M-Bus level converter (e.g. a TSS721-based master module). This codec is the framing + record layer, including decoding a record's raw value (integer / BCD / real) into a number and its VIF into a physical unit + decimal exponent; the UART transport is the application's. Bridge meters onto Wi-Fi by polling REQ_UD2 and publishing the decoded records.
Definition in file mbus.h.