AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Classes | Typedefs
painlessmesh::ack Namespace Reference

Classes

class  AckTracker
 
struct  DeliveryResult
 
class  MessageAckPackage
 
struct  PendingAck
 

Typedefs

typedef std::function< void(uint32_t nodeId, bool delivered, uint32_t latencyMs)> deliveryCallback_t
 

Detailed Description

Per-message delivery confirmation (issue #379)

When a delivery callback is passed to Mesh::sendSingle() or Mesh::sendBroadcast(), the outgoing package is tagged with a unique msgId. Receiving nodes automatically reply with a MessageAckPackage (type 630) and the sender's AckTracker matches the reply to the pending message, firing the callback with the measured round-trip latency. Messages that are not acknowledged within their timeout fire the callback with delivered = false.

Typedef Documentation

◆ deliveryCallback_t

typedef std::function<void(uint32_t nodeId, bool delivered, uint32_t latencyMs)> painlessmesh::ack::deliveryCallback_t

Callback type for delivery confirmation

Parameters
nodeIdThe destination node this result refers to
deliveredTrue when the node acknowledged the message, false when the acknowledgment timed out
latencyMsRound-trip time in ms when delivered, otherwise the configured timeout