Append a complete payload.
Producer side.
- Returns
- false when the queue is full; the caller should report the drop rather than silently losing the response.
Definition at line 81 of file ble_notify_queue.h.
81 {
82 if (data == nullptr || size == 0) {
83 return false;
84 }
85 const size_t tail =
mTail;
86 const size_t advanced =
next(tail);
87 if (advanced ==
mHead) {
88 return false;
89 }
90 fl::vector<u8> &slot =
mSlots[tail];
93 for (size_t i = 0; i < size; ++i) {
95 }
96
98 return true;
99 }
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".
volatile size_t mTail
Owned by the producer; read by the consumer to detect "empty".
void reserve(fl::size n) FL_NO_EXCEPT
void clear() FL_NO_EXCEPT
void push_back(const T &value) FL_NO_EXCEPT
References fl::vector< T >::clear(), mHead, mSlots, mTail, next(), fl::vector< T >::push_back(), and fl::vector< T >::reserve().