75
75
*
76
76
* Uncomment what you need
77
77
* These are the default values.
78
+ * You can select some simultaneously.
78
79
*/
79
80
#define BLEMIDI_CLIENT_BOND
80
81
// #define BLEMIDI_CLIENT_MITM
86
87
*/
87
88
static uint32_t userOnPassKeyRequest ()
88
89
{
89
- // FILL WITH YOUR CUSTOM AUTH METHOD or PASSKEY
90
+ // FILL WITH YOUR CUSTOM AUTH METHOD CODE or PASSKEY
90
91
// FOR EXAMPLE:
91
92
uint32_t passkey = 123456 ;
92
93
@@ -96,7 +97,7 @@ static uint32_t userOnPassKeyRequest()
96
97
return passkey;
97
98
};
98
99
99
- /*
100
+ /*
100
101
###### BLE COMMUNICATION PARAMS ######
101
102
*/
102
103
/* * Set connection parameters:
@@ -128,7 +129,7 @@ static uint32_t userOnPassKeyRequest()
128
129
* Uncomment this define if your device doesn't work propertily after a reconnection.
129
130
*
130
131
*/
131
- #define BLEMIDI_FORCE_NEW_CONNECTION
132
+ // #define BLEMIDI_FORCE_NEW_CONNECTION
132
133
133
134
/* *
134
135
*
@@ -355,12 +356,16 @@ class MyClientCallbacks : public BLEClientCallbacks
355
356
if (_bluetoothEsp32)
356
357
{
357
358
_bluetoothEsp32->disconnected ();
359
+ #ifdef BLEMIDI_FORCE_NEW_CONNECTION
360
+ // Try reconnection or search a new one
361
+ _bluetoothEsp32->scan ();
362
+ #endif // BLEMIDI_FORCE_NEW_CONNECTION
358
363
}
359
364
360
365
#ifdef BLEMIDI_FORCE_NEW_CONNECTION
361
366
// Renew Client
362
367
NimBLEDevice::deleteClient (pClient);
363
- // NimBLEDevice::createClient();
368
+ NimBLEDevice::createClient ();
364
369
pClient = nullptr ;
365
370
#endif // BLEMIDI_FORCE_NEW_CONNECTION
366
371
0 commit comments