Control Surface
develop
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
MIDI_Interfaces
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
8
BEGIN_CS_NAMESPACE
11
struct
BLEMIDIBackend
{};
12
END_BEGIN_CS_NAMESPACE
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
47
#include "
BLEMIDI/ESP32NimBLEBackend.hpp
"
48
BEGIN_CS_NAMESPACE
49
using
BLEMIDIBackend
=
ESP32NimBLEBackend
;
50
END_CS_NAMESPACE
51
#else
52
// Bluedroid backend (default)
53
#include "
BLEMIDI/ESP32BluedroidBackend.hpp
"
54
BEGIN_CS_NAMESPACE
55
using
BLEMIDIBackend
=
ESP32BluedroidBackend
;
56
END_CS_NAMESPACE
57
#endif
58
#endif
59
60
#elif (defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_RASPBERRY_PI_PICO_2W))
61
// Pico W
62
#if ENABLE_BLE
63
#include "
BLEMIDI/BTstackBackgroundBackend.hpp
"
64
BEGIN_CS_NAMESPACE
65
using
BLEMIDIBackend
=
BTstackBackgroundBackend
;
66
END_CS_NAMESPACE
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
77
#include "
BLEMIDI/ArduinoBLEBackend.hpp
"
78
BEGIN_CS_NAMESPACE
79
using
BLEMIDIBackend
=
ArduinoBLEBackend
;
80
END_CS_NAMESPACE
81
#define CS_BLE_MIDI_SUPPORTED 1
82
#endif
83
84
#ifdef CS_BLE_MIDI_SUPPORTED
85
#include "
GenericBLEMIDI_Interface.hpp
"
86
BEGIN_CS_NAMESPACE
95
struct
BluetoothMIDI_Interface
:
GenericBLEMIDI_Interface
<BLEMIDIBackend> {};
96
END_CS_NAMESPACE
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
ArduinoBLEBackend.hpp
BTstackBackgroundBackend.hpp
ESP32BluedroidBackend.hpp
ESP32BluedroidBackend
ESP32BLEBackend< ble_backend::ESP32BluedroidBLE > ESP32BluedroidBackend
ESP32 Bluedroid backend intended to be plugged into GenericBLEMIDI_Interface.
Definition
ESP32BluedroidBackend.hpp:17
ESP32NimBLEBackend.hpp
ESP32NimBLEBackend
ESP32BLEBackend< ble_backend::ESP32NimBLE > ESP32NimBLEBackend
ESP32 NimBLE backend intended to be plugged into GenericBLEMIDI_Interface.
Definition
ESP32NimBLEBackend.hpp:17
GenericBLEMIDI_Interface.hpp
NamespaceSettings.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
ArduinoBLEBackend
ArduinoBLE backend intended to be plugged into GenericBLEMIDI_Interface.
Definition
ArduinoBLEBackend.hpp:15
BTstackBackgroundBackend
Raspberry Pi Pico BTstack background backend intended to be plugged into GenericBLEMIDI_Interface.
Definition
BTstackBackgroundBackend.hpp:22
GenericBLEMIDI_Interface< BLEMIDIBackend >::GenericBLEMIDI_Interface
GenericBLEMIDI_Interface(Args &&...args)
Definition
GenericBLEMIDI_Interface.hpp:19
BLEMIDIBackend
Default backend for the BluetoothMIDI_Interface class.
Definition
BluetoothMIDI_Interface.hpp:11
BluetoothMIDI_Interface
A class for MIDI interfaces sending MIDI messages over a Bluetooth Low Energy (BLE) connection.
Definition
BluetoothMIDI_Interface.hpp:95
Generated by
1.17.0