Repository navigation
SNMP_Embedded v3.3.6 — Inform delivery confirmation: know when the manager received your inform
SNMP informs exist to be acknowledged: per RFC 3416, the receiving manager
answers an InformRequest with a Response PDU. The library has always matched
that response — by request ID — against its pending-inform queue, retried on
timeout, and retired the item on success. What it never had was a way for
your sketch to see that moment. v3.3.6 exposes it:
void onInformAck(unsigned long requestID, bool success) {
if (success) {
// the manager processed the inform with noError — confirmed delivery
} else {
// the manager responded with an error status — rejected, not lost
}
}
snmp.setInformAckCallback(onInformAck); // in setup(); nullptr to uninstallSemantics
- Fires from inside
snmp.loop()— never from an ISR, no threading
concerns, safe to touch serial, LEDs, or your own state. success = true— the manager decoded and processed the inform
(Response PDU witherrorStatus = noError).success = false— the manager answered with an error status. Your
inform was rejected, not lost: the distinction matters for alarm pipelines.- No phantom confirmations — the callback only fires for request IDs that
actually have a pending inform. Unsolicited or stale Response PDUs are
ignored, exactly as before. - Timeout is not an ack — an inform that exhausts its retries with no
response does not fire the callback (nothing arrived to acknowledge); the
queue item is retired when the retry budget runs out, unchanged. - Per-agent — each
SNMPAgentinstance carries its own hook, so
multi-agent sketches wire one per instance.
Compatibility
Additive only. The informAckCB typedef (void (*)(unsigned long, bool)) is
new in SNMPParser.h; existing sketches compile and behave identically with
or without a callback installed.
Verification
- Host suite: 262 assertions / 23 test cases (default) · 194 / 18 with
-DSNMP_NO_BUILTIN_SYSUPTIME— new cases cover ack delivery, outcome
propagation, phantom suppression, uninstall, and queue consumption. - Compile matrix: all examples and demos on ESP8266 + ESP32.