Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
BufferedBLEMIDIParser< Capacity, SizeT > Class Template Reference

#include <MIDI_Interfaces/BLEMIDI/BufferedBLEMIDIParser.hpp>

Detailed Description

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
class BufferedBLEMIDIParser< Capacity, SizeT >

FIFO buffer that you can push BLE packets into, and pop MIDI messages out of.

If SizeT is chosen to be atomic, one thread can push packets, and another thread can pop MIDI messages, without additional synchronization.

Definition at line 16 of file BufferedBLEMIDIParser.hpp.

+ Collaboration diagram for BufferedBLEMIDIParser< Capacity, SizeT >:

Public Types

using IncomingMIDIMessage = AnyMIDIMessage
 

Public Member Functions

bool pushPacket (BLEDataView packet, BLEDataType type=BLEDataType::Packet)
 Add a new BLE packet or chunk to the buffer.
 
bool popMessage (IncomingMIDIMessage &incomingMessage)
 Retrieve and remove a single incoming MIDI message from the buffer.
 

Private Attributes

BLERingBuf< Capacity, SizeT > ble_buffer {}
 Contains incoming data to be parsed.
 
BLEMIDIParser ble_parser {nullptr, 0}
 Parses the (chunked) BLE packet obtained from ble_buffer.
 
SerialMIDI_Parser parser {false}
 Parser for MIDI data extracted from the BLE packet by ble_parser.
 

Member Typedef Documentation

◆ IncomingMIDIMessage

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
using IncomingMIDIMessage = AnyMIDIMessage

Definition at line 26 of file BufferedBLEMIDIParser.hpp.

Member Function Documentation

◆ pushPacket()

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
bool pushPacket ( BLEDataView packet,
BLEDataType type = BLEDataType::Packet )
inline

Add a new BLE packet or chunk to the buffer.

Definition at line 29 of file BufferedBLEMIDIParser.hpp.

◆ popMessage()

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
bool popMessage ( IncomingMIDIMessage & incomingMessage)
inline

Retrieve and remove a single incoming MIDI message from the buffer.

Definition at line 35 of file BufferedBLEMIDIParser.hpp.

Member Data Documentation

◆ ble_buffer

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
BLERingBuf<Capacity, SizeT> ble_buffer {}
private

Contains incoming data to be parsed.

Definition at line 19 of file BufferedBLEMIDIParser.hpp.

◆ ble_parser

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
BLEMIDIParser ble_parser {nullptr, 0}
private

Parses the (chunked) BLE packet obtained from ble_buffer.

Definition at line 21 of file BufferedBLEMIDIParser.hpp.

◆ parser

template<uint16_t Capacity, class SizeT = NonatomicBLERingBufSize<uint16_t>>
SerialMIDI_Parser parser {false}
private

Parser for MIDI data extracted from the BLE packet by ble_parser.

Definition at line 23 of file BufferedBLEMIDIParser.hpp.


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