From fe1a17dfb749298262feadef18e787fb624a2632 Mon Sep 17 00:00:00 2001 From: Bernd Liesner <96044083+MicroMidi@users.noreply.github.com> Date: Mon, 21 Nov 2022 08:12:36 +0100 Subject: [PATCH] Update BLEMIDI_Transport.h Added new callback for BLE connection that returns the name of the connected device --- src/BLEMIDI_Transport.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/BLEMIDI_Transport.h b/src/BLEMIDI_Transport.h index 45b028a..377f910 100644 --- a/src/BLEMIDI_Transport.h +++ b/src/BLEMIDI_Transport.h @@ -185,6 +185,7 @@ protected: public: // callbacks void (*_connectedCallback)() = nullptr; + void (*_connectedCallbackDeviceName)(char *) = nullptr; void (*_disconnectedCallback)() = nullptr; BLEMIDI_Transport &setName(const char *deviceName) @@ -199,6 +200,12 @@ public: _connectedCallback = fptr; return *this; } + + BLEMIDI_Transport &setHandleConnected(void (*fptr)(char*)) + { + _connectedCallbackDeviceName= fptr; + return *this; + } BLEMIDI_Transport &setHandleDisconnected(void (*fptr)()) {