Control Surface  1.2.0
MIDI Control Surface library for Arduino
SysExBuffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Settings/SettingsWrapper.hpp>
4 
6 
7 class SysExBuffer {
8  private:
10  size_t SysExLength = 0;
11  bool receiving = false;
12 
13  public:
15  void start();
17  void end();
19  bool add(uint8_t data);
21  bool hasSpaceLeft() const;
23  bool isReceiving() const;
25  const uint8_t *getBuffer() const;
27  size_t getLength() const;
28 };
29 
SysExBuffer::start
void start()
Start a new SysEx message.
Definition: SysExBuffer.cpp:5
SysExBuffer::isReceiving
bool isReceiving() const
Check if the buffer is receiving a SysEx message.
Definition: SysExBuffer.cpp:31
SysExBuffer::hasSpaceLeft
bool hasSpaceLeft() const
Check if the buffer has at least 1 byte of free space available.
Definition: SysExBuffer.cpp:24
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
SysExBuffer::end
void end()
Finish the current SysEx message.
Definition: SysExBuffer.cpp:11
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
SysExBuffer
Definition: SysExBuffer.hpp:7
SysExBuffer::getLength
size_t getLength() const
Get the length of the SysEx message in the buffer.
Definition: SysExBuffer.cpp:35
SysExBuffer::receiving
bool receiving
Definition: SysExBuffer.hpp:11
SYSEX_BUFFER_SIZE
constexpr size_t SYSEX_BUFFER_SIZE
The length of the maximum System Exclusive message that can be received.
Definition: Settings/Settings.hpp:54
SysExBuffer::add
bool add(uint8_t data)
Add a byte to the current SysEx message.
Definition: SysExBuffer.cpp:16
SysExBuffer::getBuffer
const uint8_t * getBuffer() const
Get a pointer to the buffer.
Definition: SysExBuffer.cpp:33
SysExBuffer::SysExLength
size_t SysExLength
Definition: SysExBuffer.hpp:10