Skip to content

Commit db8a00a

Browse files
authored
Update BLEMIDI_Client_ESP32.h
Callback method added that returns the name of the connected BLE-MIDI device
1 parent fe1a17d commit db8a00a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/hardware/BLEMIDI_Client_ESP32.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class BLEMIDI_Client_ESP32
228228
BLERemoteCharacteristic *_characteristic = nullptr;
229229
BLERemoteService *pSvc = nullptr;
230230
bool firstTimeSend = true; //First writeValue get sends like Write with reponse for clean security flags. After first time, all messages are send like WriteNoResponse for increase transmision speed.
231-
231+
char connectedDeviceName[24];
232+
232233
BLEMIDI_Transport<class BLEMIDI_Client_ESP32> *_bleMidiTransport = nullptr;
233234

234235
bool specificTarget = false;
@@ -303,6 +304,12 @@ class BLEMIDI_Client_ESP32
303304
_bleMidiTransport->_connectedCallback();
304305
}
305306
firstTimeSend = true;
307+
308+
if (_bleMidiTransport->_connectedCallbackDeviceName)
309+
{
310+
sprintf(connectedDeviceName, "%s", myAdvCB.advDevice.getName().c_str());
311+
_bleMidiTransport->_connectedCallbackDeviceName(connectedDeviceName);
312+
}
306313
}
307314

308315
void disconnected()

0 commit comments

Comments
 (0)