mergCanBus
 All Classes Functions Typedefs
CircularBuffer.h
1 #ifndef CIRCULARBUFFER_H
2 #define CIRCULARBUFFER_H
3 
4 #define _msgSize 15
5 #define CIRCULARBUFFER_MSGS 10
6 #define CIRCULARBUFFER_SIZE CIRCULARBUFFER_MSGS*_msgSize
8 #include <Arduino.h>
9 
15 {
16  public:
18  virtual ~CircularBuffer();
19  public:
20  bool put(byte *buffer);
21  bool get(byte *buffer);
22  int getPos(){return pos;};
23  private:
24  byte _buf[CIRCULARBUFFER_SIZE];
25  int tail;
26  int op;
27  int pos;
28  int entries;
29  void incPos();
30 };
31 
32 #endif // CIRCULARBUFFER_H
CircularBuffer()
Constructor Basically set the initial values of the internal variables.
Definition: CircularBuffer.cpp:7
bool put(byte *buffer)
Add a message of the _msgSize size to the buffer.
Definition: CircularBuffer.cpp:29
Definition: CircularBuffer.h:14
virtual ~CircularBuffer()
Destructor.
Definition: CircularBuffer.cpp:18