#include <MIDI_Interfaces/BLEMIDI/PollingBLEMIDISender.hpp>
Class that buffers MIDI BLE packets.
Definition at line 14 of file PollingBLEMIDISender.hpp.
Classes | |
struct | ProtectedBuilder |
Public Member Functions | |
PollingBLEMIDISender ()=default | |
PollingBLEMIDISender (const PollingBLEMIDISender &)=delete | |
PollingBLEMIDISender & | operator= (const PollingBLEMIDISender &)=delete |
~PollingBLEMIDISender () | |
void | begin () |
Initialize. | |
ProtectedBuilder | acquirePacket () |
Acquire exclusive access to the buffer. | |
void | releasePacketAndNotify (ProtectedBuilder &lck) |
Release exclusive access to the buffer and notify the sender thread that data is available. | |
void | sendNow (ProtectedBuilder &lck) |
Sends the data immediately without waiting for the timeout. | |
void | updateMTU (uint16_t mtu) |
Set the maximum transmission unit of the Bluetooth link. | |
uint16_t | getMinMTU () const |
Get the minimum MTU of all connected clients. | |
void | forceMinMTU (uint16_t mtu) |
Force the MTU to an artificially small value (used for testing). | |
void | setTimeout (std::chrono::milliseconds timeout) |
Set the timeout, the number of milliseconds to buffer the outgoing MIDI messages. | |
Private Member Functions | |
void | sendData (BLEDataView)=delete |
Actually perform the BLE notification with the given data. | |
Private Attributes | |
BLEMIDIPacketBuilder | packet |
View of the data to send. | |
unsigned long | timeout {10} |
Timeout before the sender thread sends a packet. | |
unsigned long | packet_start_time {0} |
Time point when the packet was started. | |
uint16_t | min_mtu {23} |
The minimum MTU of all connected clients. | |
uint16_t | force_min_mtu {515} |
Override the minimum MTU (0 means don't override, nonzero overrides if it's smaller than the minimum MTU of the clients). | |
|
default |
|
delete |
~PollingBLEMIDISender | ( | ) |
|
delete |
ProtectedBuilder acquirePacket | ( | ) |
Acquire exclusive access to the buffer.
packet
member. void releasePacketAndNotify | ( | ProtectedBuilder & | lck | ) |
Release exclusive access to the buffer and notify the sender thread that data is available.
void sendNow | ( | ProtectedBuilder & | lck | ) |
Sends the data immediately without waiting for the timeout.
Set the maximum transmission unit of the Bluetooth link.
Used to compute the MIDI BLE packet size.
Get the minimum MTU of all connected clients.
Definition at line 42 of file PollingBLEMIDISender.hpp.
Force the MTU to an artificially small value (used for testing).
Set the timeout, the number of milliseconds to buffer the outgoing MIDI messages.
|
privatedelete |
Actually perform the BLE notification with the given data.
|
private |
View of the data to send.
Definition at line 56 of file PollingBLEMIDISender.hpp.
Timeout before the sender thread sends a packet.
Definition at line 59 of file PollingBLEMIDISender.hpp.
Time point when the packet was started.
Definition at line 61 of file PollingBLEMIDISender.hpp.
The minimum MTU of all connected clients.
Definition at line 65 of file PollingBLEMIDISender.hpp.
Override the minimum MTU (0 means don't override, nonzero overrides if it's smaller than the minimum MTU of the clients).
Definition at line 69 of file PollingBLEMIDISender.hpp.