15template <
class Backend>
18 template <
class... Args>
20 :
backend {std::forward<Args>(args)...} {}
24 template <
class L,
class F>
36 const char *
getName()
const override {
return "ble"; }
115#include "GenericBLEMIDI_Interface.ipp"
Type definitions and callback interfaces for communication between the low-level BLE stacks and highe...
MIDIReadEvent
Values returned by the MIDI reading functions.
#define BEGIN_CS_NAMESPACE
Bluetooth Low Energy MIDI Interface.
ChannelMessage getChannelMessage() const
Return the received channel voice message.
RealTimeMessage getRealTimeMessage() const
Return the received real-time message.
Backend::IncomingMIDIMessage incomingMessage
Incoming message that can be from retrieved using the getChannelMessage(), getSysCommonMessage(),...
void setTimeout(std::chrono::milliseconds timeout)
Set the timeout, the number of milliseconds to buffer the outgoing MIDI messages.
void sendImpl(L &lck, F add_to_buffer)
void sendChannelMessageImpl(ChannelMessage) override
Low-level function for sending a MIDI channel voice message.
void handleStall() override
Call back that should finish any MIDI messages that are in progress, and un-stall the pipe or MIDI so...
void update() override
Poll the backend (if necessary) and invoke the callbacks for any received MIDI messages,...
void sendNowImpl() override
Low-level function for sending any buffered outgoing MIDI messages.
SysCommonMessage getSysCommonMessage() const
Return the received system common message.
void sendRealTimeImpl(RealTimeMessage) override
Low-level function for sending a MIDI real-time message.
const char * getName() const override
Get the staller's name for debugging purposes.
Backend backend
Low-level BLE backend for sending and receiving MIDI over BLE packets.
void begin() override
Initialize the BLE hardware and start advertising as a MIDI over BLE peripheral.
bool isConnected() const
Returns true if a BLE central is currently connected.
void sendSysExImpl(SysExMessage) override
Low-level function for sending a system exclusive MIDI message.
BLESettings ble_settings
BLE backend configuration option.
void sendSysCommonImpl(SysCommonMessage) override
Low-level function for sending a MIDI system common message.
void setName(const char *name)
Set the BLE device name.
GenericBLEMIDI_Interface(Args &&...args)
MIDIReadEvent read()
Try reading and parsing a single incoming MIDI message.
SysExMessage getSysExMessage() const
Return the received system exclusive message.
uint16_t getTimestamp() const
Get the BLE-MIDI timestamp of the latest MIDI message.
An abstract class for MIDI interfaces.
static void updateIncoming(MIDIInterface_t *iface)
Read, parse and dispatch incoming MIDI messages on the given interface.
Configuration options for the low-level BLE code.
virtual void handleStall()=0
Call back that should finish any MIDI messages that are in progress, and un-stall the pipe or MIDI so...