34#define SERIAL_BUFFER_SIZE 64
43 volatile int _numElems;
51 int availableForStore();
56 int nextIndex(
int index);
57 inline bool isEmpty()
const {
return (_numElems == 0); }
71void RingBufferN<N>::store_char( uint8_t c )
79 _aucBuffer[_iHead] = c ;
80 _iHead = nextIndex(_iHead);
81 _numElems = _numElems + 1;
86void RingBufferN<N>::clear()
94int RingBufferN<N>::read_char()
99 uint8_t value = _aucBuffer[_iTail];
100 _iTail = nextIndex(_iTail);
101 _numElems = _numElems - 1;
107int RingBufferN<N>::available()
113int RingBufferN<N>::availableForStore()
115 return (N - _numElems);
119int RingBufferN<N>::peek()
124 return _aucBuffer[_iTail];
128int RingBufferN<N>::nextIndex(
int index)
130 return (uint32_t)(index + 1) % N;
134bool RingBufferN<N>::isFull()
136 return (_numElems == N);
Definition RingBuffer.h:38
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31