Manual priority buffer for offline / Internet-unavailable mode
This is a storage container only. It does NOT transmit anything on its own: painlessMesh will not enqueue, flush, or deliver messages automatically, and there is no connectivity-restored trigger inside the library. The application owns the send loop — enqueue when your upstream (MQTT/HTTP/etc.) is down, drain via getMessages() / mesh.flushMessageQueue() and remove() / mesh.removeQueuedMessage() when your own connectivity check tells you it is safe to resend.
Provides priority-based message queueing with support for:
- Priority levels (CRITICAL messages evicted last, but may still be dropped if the queue is full and all entries are CRITICAL)
- Queue size limits with intelligent eviction
- Statistics tracking
- State change callbacks
Example usage:
uint32_t
size = queue.size();
auto messages = queue.getMessages();
for (auto& msg : messages) {
if (sendToCloud(msg.payload, msg.destination)) {
queue.remove(msg.id);
}
}
Definition message_queue.hpp:112
uint32_t size() const
Definition message_queue.hpp:200
@ PRIORITY_CRITICAL
Definition message_queue.hpp:19