Skip to content

SNMP_Embedded v3.3.6 — Inform delivery confirmation: know when the manager received your inform

Choose a tag to compare

@syntax1269 syntax1269 released this 06 Sep 01:23
· 7 commits to main since this release

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 uninstall

Semantics

  • 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 with errorStatus = 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 SNMPAgent instance 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.