Control Surface main
MIDI Control Surface library for Arduino
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
BLEMIDIParser Class Reference

#include <MIDI_Parsers/BLEMIDIParser.hpp>

Detailed Description

Class for parsing BLE-MIDI packets.

It doesn't parse the actual MIDI messages, it just extracts the relevant MIDI data from the BLE packets.

Definition at line 16 of file BLEMIDIParser.hpp.

+ Collaboration diagram for BLEMIDIParser:

Public Member Functions

 BLEMIDIParser (const uint8_t *data, size_t length)
 
bool pull (uint8_t &output)
 Get the next MIDI byte from the BLE packet (if available). More...
 
uint16_t getTimestamp () const
 

Static Private Member Functions

static bool isData (uint8_t data)
 Check if the given byte is a data byte (and not a header, timestamp or status byte). More...
 

Private Attributes

const uint8_t * data
 
const uint8_t *const end
 
bool prevWasTimestamp = true
 
uint16_t timestamp = 0
 

Constructor & Destructor Documentation

◆ BLEMIDIParser()

BLEMIDIParser ( const uint8_t *  data,
size_t  length 
)
inline

Definition at line 18 of file BLEMIDIParser.hpp.

Member Function Documentation

◆ pull()

bool pull ( uint8_t &  output)
inline

Get the next MIDI byte from the BLE packet (if available).

Returns
True if a byte was available, false otherwise.

Definition at line 50 of file BLEMIDIParser.hpp.

◆ getTimestamp()

uint16_t getTimestamp ( ) const
inline

Definition at line 78 of file BLEMIDIParser.hpp.

◆ isData()

static bool isData ( uint8_t  data)
inlinestaticprivate

Check if the given byte is a data byte (and not a header, timestamp or status byte).

Definition at line 89 of file BLEMIDIParser.hpp.

Member Data Documentation

◆ data

const uint8_t* data
private

Definition at line 81 of file BLEMIDIParser.hpp.

◆ end

const uint8_t* const end
private

Definition at line 82 of file BLEMIDIParser.hpp.

◆ prevWasTimestamp

bool prevWasTimestamp = true
private

Definition at line 83 of file BLEMIDIParser.hpp.

◆ timestamp

uint16_t timestamp = 0
private

Definition at line 84 of file BLEMIDIParser.hpp.


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