Skip to content

Commit fe1a17d

Browse files
authored
Update BLEMIDI_Transport.h
Added new callback for BLE connection that returns the name of the connected device
1 parent 929c2fc commit fe1a17d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/BLEMIDI_Transport.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class BLEMIDI_Transport
185185
public:
186186
// callbacks
187187
void (*_connectedCallback)() = nullptr;
188+
void (*_connectedCallbackDeviceName)(char *) = nullptr;
188189
void (*_disconnectedCallback)() = nullptr;
189190

190191
BLEMIDI_Transport &setName(const char *deviceName)
@@ -199,6 +200,12 @@ class BLEMIDI_Transport
199200
_connectedCallback = fptr;
200201
return *this;
201202
}
203+
204+
BLEMIDI_Transport &setHandleConnected(void (*fptr)(char*))
205+
{
206+
_connectedCallbackDeviceName= fptr;
207+
return *this;
208+
}
202209

203210
BLEMIDI_Transport &setHandleDisconnected(void (*fptr)())
204211
{

0 commit comments

Comments
 (0)