Skip to content

Commit f31f8db

Browse files
authored
Code Example changed for new settings struct
1 parent fe3412b commit f31f8db

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

examples/MidiBle_Client/MidiBle_Client.ino

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@
2828
#include <Arduino.h>
2929
#include <BLEMIDI_Transport.h>
3030

31-
struct CustomBufferSizeSettings : public BLEMIDI_NAMESPACE::DefaultSettings {
32-
static const size_t MaxBufferSize = 16;
33-
};
34-
3531
#include <hardware/BLEMIDI_Client_ESP32.h>
36-
3732
//#include <hardware/BLEMIDI_ESP32_NimBLE.h>
3833
//#include <hardware/BLEMIDI_ESP32.h>
3934
//#include <hardware/BLEMIDI_ArduinoBLE.h>
4035

41-
BLEMIDI_CREATE_CUSTOM_INSTANCE("Esp32-BLE-MIDI", MIDI, CustomBufferSizeSettings); // Connect to first server found
36+
//See DefaultSettingsClient in hardware/BLEMIDI_Client_ESP32.h for more configurable settings
37+
// If you do not redefine a parameter, it will use the default value for these parameter
38+
struct CustomBufferSizeSettings : public BLEMIDI_NAMESPACE::DefaultSettingsClient {
39+
static const size_t MaxBufferSize = 16;
40+
};
41+
42+
BLEMIDI_CREATE_CUSTOM_INSTANCE("Esp32-BLE-MIDI", MIDI, CustomBufferSizeSettings); // Connect to a server named "Esp32-BLE-MIDI" and use CustomBufferSizeSettings as settings of client
4243

43-
//BLEMIDI_CREATE_INSTANCE("",MIDI) //Connect to the first server found
44-
//BLEMIDI_CREATE_INSTANCE("f2:c1:d9:36:e7:6b",MIDI) //Connect to a specific BLE address server
45-
//BLEMIDI_CREATE_INSTANCE("MyBLEserver",MIDI) //Connect to a specific name server
44+
//BLEMIDI_CREATE_INSTANCE("",MIDI) //Connect to the first server found, using default settings
45+
//BLEMIDI_CREATE_INSTANCE("f2:c1:d9:36:e7:6b",MIDI) //Connect to a specific BLE address server, using default settings
46+
//BLEMIDI_CREATE_INSTANCE("MyBLEserver",MIDI) //Connect to a specific name server, using default settings
4647

4748
#ifndef LED_BUILTIN
4849
#define LED_BUILTIN 2 //modify for match with yout board

0 commit comments

Comments
 (0)