FastLED 3.10.6
Loading...
Searching...
No Matches
fl::net::ble::BleNotifyQueue Class Reference

Detailed Description

Bounded FIFO of outbound notification payloads, drained in MTU-sized chunks.

Exactly one payload is "in flight" at a time: chunkData() / chunkSize() always describe the front payload at the current offset, and the front is popped only once advance() has consumed all of it.

Definition at line 57 of file ble_notify_queue.h.

#include <ble_notify_queue.h>

+ Collaboration diagram for fl::net::ble::BleNotifyQueue:

Public Member Functions

void advance (size_t sent)
 Record that sent bytes were accepted by the stack.
 
const u8 * chunkData () const
 Start of the next chunk, or nullptr when the queue is empty.
 
size_t chunkSize (size_t max_payload) const
 Size of the next chunk, capped at max_payload.
 
void clear ()
 Drop every queued payload — used when the link goes away.
 
size_t depth () const
 Number of complete payloads queued, including the one in flight.
 
void dropFront ()
 Drop the in-flight payload and move to the next one.
 
bool empty () const
 True when nothing is waiting to be sent.
 
bool push (const char *data, size_t size)
 Append a complete payload.
 
size_t remaining () const
 Bytes of the in-flight payload not yet accepted by the stack.
 

Static Public Attributes

static constexpr size_t kCapacity = 4
 Maximum number of complete responses held at once.
 

Static Private Member Functions

static size_t next (size_t index)
 

Private Attributes

volatile size_t mHead = 0
 Owned by the consumer; read by the producer to detect "full".
 
size_t mOffset = 0
 Bytes of mSlots[mHead] already accepted. Consumer-only.
 
fl::vector< u8 > mSlots [kSlots]
 
volatile size_t mTail = 0
 Owned by the producer; read by the consumer to detect "empty".
 

Static Private Attributes

static constexpr size_t kSlots = kCapacity + 1
 One spare slot keeps "empty" and "full" distinguishable without a shared count, which is what makes the ring safe across the two contexts.
 

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