Update BLEMIDI_Transport.h

Added new callback for BLE connection that returns the name of the connected device
This commit is contained in:
Bernd Liesner 2022-11-21 08:12:36 +01:00 committed by GitHub
parent 929c2fc049
commit fe1a17dfb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -185,6 +185,7 @@ protected:
public:
// callbacks
void (*_connectedCallback)() = nullptr;
void (*_connectedCallbackDeviceName)(char *) = nullptr;
void (*_disconnectedCallback)() = nullptr;
BLEMIDI_Transport &setName(const char *deviceName)
@ -200,6 +201,12 @@ public:
return *this;
}
BLEMIDI_Transport &setHandleConnected(void (*fptr)(char*))
{
_connectedCallbackDeviceName= fptr;
return *this;
}
BLEMIDI_Transport &setHandleDisconnected(void (*fptr)())
{
_disconnectedCallback = fptr;