Control Surface pin-t-adl
MIDI Control Surface library for Arduino
midi.h
Go to the documentation of this file.
1#pragma once
2
9#include <stdint.h>
10#include <stddef.h>
11#include <stdbool.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
20typedef void (*midi_mtu_callback_t)(uint16_t);
26uint16_t midi_get_mtu(void);
27
31typedef void (*midi_write_callback_t)(const uint8_t *, size_t);
35
37bool midi_notify(const uint8_t *data, size_t len);
38
40void set_midi_ble_name(const char *name);
41
44bool midi_init();
48
49#ifdef __cplusplus
50}
51#endif
bool midi_deinit()
Cleanup the MIDI BLE application and de-initialize the Bluetooth stack.
bool midi_init()
Initialize the Bluetooth stack and register the MIDI BLE application with the Bluedroid driver.
void midi_set_write_callback(midi_write_callback_t cb)
Set the callback that is to be called when the client writes (sends) a MIDI packet.
void(* midi_write_callback_t)(const uint8_t *, size_t)
Type for the BLE MIDI write callback.
Definition: midi.h:31
void midi_set_mtu_callback(midi_mtu_callback_t cb)
Set the callback that is to be called when the MTU negotiation with the BLE client is finished.
bool midi_notify(const uint8_t *data, size_t len)
Send a MIDI BLE notification to the client.
void(* midi_mtu_callback_t)(uint16_t)
Type for the MTU negotiation callback.
Definition: midi.h:20
uint16_t midi_get_mtu(void)
Get the current MTU (maximum transmission unit) of the link with the BLE client.
void set_midi_ble_name(const char *name)
Set the name of the BLE device. Must be set before calling midi_init().