Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
MIDI_Parsers
SysExBuffer.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
Settings/SettingsWrapper.hpp
>
4
5
BEGIN_CS_NAMESPACE
6
13
class
SysExBuffer
{
14
private
:
15
uint8_t
buffer
[
SYSEX_BUFFER_SIZE
];
16
uint16_t
length
= 0;
17
bool
receiving
=
false
;
18
19
public
:
21
void
start
();
23
void
end
();
25
void
add
(uint8_t data);
27
void
add
(
const
uint8_t *data, uint8_t len);
29
bool
hasSpaceLeft
(uint8_t amount = 1)
const
;
31
bool
isReceiving
()
const
;
33
const
uint8_t *
getBuffer
()
const
;
35
uint16_t
getLength
()
const
;
36
};
37
38
END_CS_NAMESPACE
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
SettingsWrapper.hpp
SYSEX_BUFFER_SIZE
constexpr uint16_t SYSEX_BUFFER_SIZE
The length of the maximum System Exclusive message that can be received.
Definition
Settings/Settings.hpp:48
SysExBuffer
Helper for storing the System Exclusive messages being received by a MIDI parser.
Definition
SysExBuffer.hpp:13
SysExBuffer::getBuffer
const uint8_t * getBuffer() const
Get a pointer to the buffer.
Definition
SysExBuffer.cpp:32
SysExBuffer::length
uint16_t length
Definition
SysExBuffer.hpp:16
SysExBuffer::receiving
bool receiving
Definition
SysExBuffer.hpp:17
SysExBuffer::buffer
uint8_t buffer[SYSEX_BUFFER_SIZE]
Definition
SysExBuffer.hpp:15
SysExBuffer::hasSpaceLeft
bool hasSpaceLeft(uint8_t amount=1) const
Check if the buffer has at least amount bytes of free space available.
Definition
SysExBuffer.cpp:23
SysExBuffer::start
void start()
Start a new SysEx message.
Definition
SysExBuffer.cpp:6
SysExBuffer::add
void add(uint8_t data)
Add a byte to the current SysEx message.
Definition
SysExBuffer.cpp:13
SysExBuffer::end
void end()
Finish the current SysEx message.
Definition
SysExBuffer.cpp:11
SysExBuffer::getLength
uint16_t getLength() const
Get the length of the SysEx message in the buffer.
Definition
SysExBuffer.cpp:34
SysExBuffer::isReceiving
bool isReceiving() const
Check if the buffer is receiving a SysEx message.
Definition
SysExBuffer.cpp:30
Generated by
1.17.0