FastLED 3.10.6
Loading...
Searching...
No Matches

◆ advance()

void fl::net::ble::BleNotifyQueue::advance ( size_t sent)
inline

Record that sent bytes were accepted by the stack.

Consumer side.

Pops the front payload once it has been fully sent, so the next chunkData() describes the following response.

Definition at line 144 of file ble_notify_queue.h.

144 {
145 if (empty() || sent == 0) {
146 return;
147 }
148 const size_t head = mHead;
149 const size_t size = mSlots[head].size();
150 mOffset += sent;
151 if (mOffset >= size) {
152 mSlots[head].clear();
153 mOffset = 0;
154 // Release the slot last, so the producer cannot reuse it while
155 // it is still being cleared.
156 mHead = next(head);
157 }
158 }
size_t mOffset
Bytes of mSlots[mHead] already accepted. Consumer-only.
fl::vector< u8 > mSlots[kSlots]
static size_t next(size_t index)
volatile size_t mHead
Owned by the consumer; read by the producer to detect "full".
bool empty() const
True when nothing is waiting to be sent.

References empty(), mHead, mOffset, mSlots, and next().

+ Here is the call graph for this function: