Control Surface pin-t-adl
MIDI Control Surface library for Arduino
Public Member Functions | Private Attributes | List of all members
SysExBuffer Class Reference

#include <MIDI_Parsers/SysExBuffer.hpp>

Detailed Description

Helper for storing the System Exclusive messages being received by a MIDI parser.

Definition at line 13 of file SysExBuffer.hpp.

+ Collaboration diagram for SysExBuffer:

Public Member Functions

void start ()
 Start a new SysEx message. More...
 
void end ()
 Finish the current SysEx message. More...
 
void add (uint8_t data)
 Add a byte to the current SysEx message. More...
 
void add (const uint8_t *data, uint8_t len)
 Add multiple bytes to the current SysEx message. More...
 
bool hasSpaceLeft (uint8_t amount=1) const
 Check if the buffer has at least amount bytes of free space available. More...
 
bool isReceiving () const
 Check if the buffer is receiving a SysEx message. More...
 
const uint8_t * getBuffer () const
 Get a pointer to the buffer. More...
 
uint16_t getLength () const
 Get the length of the SysEx message in the buffer. More...
 

Private Attributes

uint8_t buffer [SYSEX_BUFFER_SIZE]
 
uint16_t length = 0
 
bool receiving = false
 

Member Function Documentation

◆ start()

void start ( )

Start a new SysEx message.

Definition at line 6 of file SysExBuffer.cpp.

◆ end()

void end ( )

Finish the current SysEx message.

Definition at line 11 of file SysExBuffer.cpp.

◆ add() [1/2]

void add ( uint8_t  data)

Add a byte to the current SysEx message.

Definition at line 15 of file SysExBuffer.cpp.

◆ add() [2/2]

void add ( const uint8_t *  data,
uint8_t  len 
)

Add multiple bytes to the current SysEx message.

Definition at line 20 of file SysExBuffer.cpp.

◆ hasSpaceLeft()

bool hasSpaceLeft ( uint8_t  amount = 1) const

Check if the buffer has at least amount bytes of free space available.

Definition at line 25 of file SysExBuffer.cpp.

◆ isReceiving()

bool isReceiving ( ) const

Check if the buffer is receiving a SysEx message.

Definition at line 32 of file SysExBuffer.cpp.

◆ getBuffer()

const uint8_t * getBuffer ( ) const

Get a pointer to the buffer.

Definition at line 34 of file SysExBuffer.cpp.

◆ getLength()

uint16_t getLength ( ) const

Get the length of the SysEx message in the buffer.

Definition at line 36 of file SysExBuffer.cpp.

Member Data Documentation

◆ buffer

uint8_t buffer[SYSEX_BUFFER_SIZE]
private

Definition at line 15 of file SysExBuffer.hpp.

◆ length

uint16_t length = 0
private

Definition at line 16 of file SysExBuffer.hpp.

◆ receiving

bool receiving = false
private

Definition at line 17 of file SysExBuffer.hpp.


The documentation for this class was generated from the following files: