3#include <Settings/NamespaceSettings.hpp>
13template <
class Derived>
79#include "PollingBLEMIDISender.ipp"
Type definitions and callback interfaces for communication between the low-level BLE stacks and highe...
#define BEGIN_CS_NAMESPACE
Class for building MIDI over Bluetooth Low Energy packets.
Class that buffers MIDI BLE packets.
PollingBLEMIDISender()=default
BLEMIDIPacketBuilder packet
View of the data to send.
void sendData(BLEDataView)=delete
Actually perform the BLE notification with the given data.
uint16_t getMinMTU() const
Get the minimum MTU of all connected clients.
void setTimeout(std::chrono::milliseconds timeout)
Set the timeout, the number of milliseconds to buffer the outgoing MIDI messages.
void forceMinMTU(uint16_t mtu)
Force the MTU to an artificially small value (used for testing).
unsigned long timeout
Timeout before the sender thread sends a packet.
PollingBLEMIDISender(const PollingBLEMIDISender &)=delete
unsigned long packet_start_time
Time point when the packet was started.
uint16_t min_mtu
The minimum MTU of all connected clients.
ProtectedBuilder acquirePacket()
Acquire exclusive access to the buffer.
PollingBLEMIDISender & operator=(const PollingBLEMIDISender &)=delete
void releasePacketAndNotify(ProtectedBuilder &lck)
Release exclusive access to the buffer and notify the sender thread that data is available.
void updateMTU(uint16_t mtu)
Set the maximum transmission unit of the Bluetooth link.
uint16_t force_min_mtu
Override the minimum MTU (0 means don't override, nonzero overrides if it's smaller than the minimum ...
void sendNow(ProtectedBuilder &lck)
Sends the data immediately without waiting for the timeout.
Non-owning, std::span-style read-only view of BLE data.
BLEMIDIPacketBuilder * packet