Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
BluetoothMIDI_Interface.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifndef CS_BLE_MIDI_NOT_SUPPORTED
4
5#include <Settings/NamespaceSettings.hpp>
6
7#ifdef DOXYGEN
15#define CS_BLE_MIDI_SUPPORTED 1
19#define CS_USE_NIMBLE
20
21#elif defined(ESP32)
22#include <sdkconfig.h>
23// ESP32 with BLE support (arduino-esp32 < 3.3.0)
24#if CONFIG_BT_BLE_ENABLED
25#ifdef CS_USE_NIMBLE
26#define CS_BLE_MIDI_BACKEND_NIMBLE 1
27#else
28#define CS_BLE_MIDI_BACKEND_NIMBLE 0
29#endif
30#define CS_BLE_MIDI_SUPPORTED 1
31// ESP32 with native Nimble support (arduino-esp32 >= 3.3.0)
32#elif CONFIG_BT_NIMBLE_ENABLED
33#define CS_BLE_MIDI_BACKEND_NIMBLE 1
34#define CS_BLE_MIDI_SUPPORTED 1
35// ESP32 with native Bluedroid support (arduino-esp32 >= 3.3.0) -- Untested
36#elif CONFIG_BT_BLUEDROID_ENABLED
37#ifdef CS_USE_NIMBLE
38#pragma warning ("CS_USE_NIMBLE ignored (CONFIG_BT_NIMBLE_ENABLED != 1)")
39#endif
40#define CS_BLE_MIDI_BACKEND_NIMBLE 0
41#define CS_BLE_MIDI_SUPPORTED 1
42#endif
43
44#if CS_BLE_MIDI_SUPPORTED
45// NimBLE backend
46#if CS_BLE_MIDI_BACKEND_NIMBLE
51#else
52// Bluedroid backend (default)
57#endif
58#endif
59
60#elif defined(ARDUINO_RASPBERRY_PI_PICO_W)
61// Pico W
62#if ENABLE_BLE
67#define CS_BLE_MIDI_SUPPORTED 1
68#endif
69
70#elif (defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARDUINO_NANO33BLE)) || \
71 (defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040)) || \
72 (defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_GIGA)) || \
73 defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_SAMD_NANO_33_IOT) || \
74 defined(ARDUINO_SAMD_MKRWIFI1010) || defined(CS_USE_ARDUINOBLE)
75// Arduino Nano 33 BLE, RP2040, Arduino GIGA, Arduino UNO R4 WiFi,
76// Arduino Nano 33 IoT, Arduino MKR 1010 WiFi
81#define CS_BLE_MIDI_SUPPORTED 1
82#endif
83
84#ifdef CS_BLE_MIDI_SUPPORTED
97#endif
98
99#ifndef CS_BLE_MIDI_SUPPORTED
100#define CS_BLE_MIDI_NOT_SUPPORTED 1
101#endif
102
103#endif // CS_BLE_MIDI_NOT_SUPPORTED
ESP32BLEBackend< ble_backend::ESP32BluedroidBLE > ESP32BluedroidBackend
ESP32 Bluedroid backend intended to be plugged into GenericBLEMIDI_Interface.
ESP32BLEBackend< ble_backend::ESP32NimBLE > ESP32NimBLEBackend
ESP32 NimBLE backend intended to be plugged into GenericBLEMIDI_Interface.
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
ArduinoBLE backend intended to be plugged into GenericBLEMIDI_Interface.
Raspberry Pi Pico BTstack background backend intended to be plugged into GenericBLEMIDI_Interface.
Bluetooth Low Energy MIDI Interface.
Array< T, N > copyAs(const Array< U, N > &src)
Copy an Array to an Array of a different type.
Default backend for the BluetoothMIDI_Interface class.
A class for MIDI interfaces sending MIDI messages over a Bluetooth Low Energy (BLE) connection.