Repository navigation
SNMP_Embedded v3.3.5 — Five-input system-group call: the library deduces your buffer sizes
v3.3.4 introduced the one-call RFC 1213 system-group helper, but the read-write
strings needed an explicit sizeof() per buffer — safe, yet noisy. v3.3.5
listens to how the API actually reads:
// Before (v3.3.4): 8 arguments, three sizeof() calls
snmp.addRFC1213SystemGroup(sysDescr,
&sysContact, sizeof(sysContactBuf),
&sysName, sizeof(sysNameBuf),
&sysLocation,sizeof(sysLocBuf), &sysServices);
// Now (v3.3.5): 5 arguments, zero sizeof()
snmp.addRFC1213SystemGroup(sysDescr, sysContactBuf, sysNameBuf, sysLocBuf, &sysServices);Skip an OID in one self-documenting token — RFC1213_SKIP replaces the
nullptr, 0 pair:
// only sysName + sysLocation exist on this agent:
snmp.addRFC1213SystemGroup(sysDescr, RFC1213_SKIP, sysNameBuf, sysLocBuf, nullptr);Safety didn't move — it got stricter
- The capacity is deduced from the array itself, so a SET can still never
overflow your storage (over-long SETs answerWRONG_LENGTH, covered by a new
host test). SysBufaccepts real arrays orRFC1213_SKIP— and not a barechar*.
A pointer has no deducible capacity, so that mistake fails to compile
instead of silently guessing.- Heap or runtime-sized storage? The v3.3.4 pointer+len overload remains; both
forms work side by side (andSNMP_Sensornow shows them together).
Under the hood
- New
StringBufCallbackbinds thechar[]directly — same semantics as the
pointer form, zero allocation. - All five sketches/examples updated to teach the auto-size form.
Verification
- Host suite: 243 assertions / 22 test cases (default) · 175 / 17 with
-DSNMP_NO_BUILTIN_SYSUPTIME— both exit clean. - Compile matrix: 8/8 (2 examples × ESP8266 + ESP32, 2 CLI demos,
PlatformIO minimal × 2 envs). - Hardware (ESP8266): clean boot, 1-minute flood soak at ~3 ops/s — 0 pool
alarms, 0 crashes, heap floor 23,504 B.