3#if CONFIG_BT_BLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED
9namespace cs::midi_ble_bluedroid {
16using namespace cs::midi_ble_bluedroid;
45#if __cplusplus >= 201402
46 return std::exchange(
view, {});
60namespace cs::midi_ble_bluedroid {
@ ConsumeImmediately
Buffer is valid only during the callback. Do not keep any pointers to it.
Advertising the MIDI service for Bluetooth Low Energy.
void advertising_set_connection_interval(uint16_t itvl_min, uint16_t itvl_max)
Set the connection interval range in the advertising data.
void midi_ble_instance_handle_data(uint16_t conn_handle, const uint8_t *data, uint16_t length)
void midi_ble_instance_handle_disconnect(uint16_t conn_handle)
void midi_ble_instance_handle_subscribe(uint16_t conn_handle, uint16_t char_handle, bool notify)
void midi_ble_instance_handle_connect(uint16_t conn_handle)
void midi_ble_instance_handle_mtu(uint16_t conn_handle, uint16_t mtu)
Callable that returns the next chunk of data from a BLE packet when called.
Defines the interface for callback functions registered by the low-level BLE code.
Array< T, N > copyAs(const Array< U, N > &src)
Copy an Array to an Array of a different type.
Public MIDI over Bluetooth Low Energy API.
bool midi_init()
Initialize the Bluetooth stack and register the MIDI BLE application with the Bluedroid driver.
void set_security_initiate_encryption(bool security_initiate_encryption_)
Configure whether the Arduino should initiate the bonding/secure connection.
void set_midi_ble_name(const char *name)
Set the name of the BLE device. Must be set before calling midi_init().
bool midi_notify(uint16_t conn_handle, uint16_t char_handle, const uint8_t *data, size_t len)
Send a MIDI BLE notification to the client.
void notify(BLEDataView data)
bool init(MIDIBLEInstance &instance, BLESettings ble_settings)
static in_place_t in_place
Represents a handle to a local GATT characteristic.
Represents a handle to the connection to another device.
Non-owning, std::span-style read-only view of BLE data.
Configuration options for the low-level BLE code.
struct BLESettings::@4 connection_interval
Connection intervals as multiples of 1.25 milliseconds (e.g.0x000C = 15 ms).
const char * device_name
Device name (used for advertising)
bool initiate_security
Set to true if you want the Arduino to always initiate the Bluetooth bonding or secure connection.