AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Public Attributes | List of all members
painlessmesh::SendOptions Struct Reference

#include <mesh.hpp>

Public Attributes

uint8_t priority = protocol::PRIORITY_NORMAL
 
ack::deliveryCallback_t ackCallback = nullptr
 
uint32_t ackTimeoutMs = 5000
 

Detailed Description

Options for sendSingle() / sendBroadcast() (issue #384)

Bundles the outbound queue priority and the optional delivery confirmation into one composable struct, so a message can be both prioritized and acknowledgment-tracked in a single call — something the separate priority and ack overloads cannot express:

options.ackCallback = [](uint32_t nodeId, bool delivered, uint32_t ms) {};
mesh.sendSingle(dest, msg, options);
constexpr uint8_t PRIORITY_HIGH
Definition protocol.hpp:72
Definition mesh.hpp:62
uint8_t priority
Definition mesh.hpp:65
ack::deliveryCallback_t ackCallback
Definition mesh.hpp:69

The priority is carried on the wire (serialized as "prio" only when it deviates from PRIORITY_NORMAL), so intermediate nodes re-enqueue a forwarded package at the sender's priority instead of dropping it to NORMAL after the first hop.

Member Data Documentation

◆ ackCallback

ack::deliveryCallback_t painlessmesh::SendOptions::ackCallback = nullptr

Optional delivery confirmation callback; fires once per expected node with delivered = true and the round-trip latency, or delivered = false on timeout. nullptr (default) disables tracking.

◆ ackTimeoutMs

uint32_t painlessmesh::SendOptions::ackTimeoutMs = 5000

How long to wait for acknowledgments before reporting failure.

◆ priority

uint8_t painlessmesh::SendOptions::priority = protocol::PRIORITY_NORMAL

Outbound queue priority: PRIORITY_CRITICAL (0), PRIORITY_HIGH (1), PRIORITY_NORMAL (2, default) or PRIORITY_LOW (3).


The documentation for this struct was generated from the following file: