Merge db8a00a9f1 into 929c2fc049
This commit is contained in:
commit
e378194ff4
|
|
@ -185,6 +185,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
// callbacks
|
// callbacks
|
||||||
void (*_connectedCallback)() = nullptr;
|
void (*_connectedCallback)() = nullptr;
|
||||||
|
void (*_connectedCallbackDeviceName)(char *) = nullptr;
|
||||||
void (*_disconnectedCallback)() = nullptr;
|
void (*_disconnectedCallback)() = nullptr;
|
||||||
|
|
||||||
BLEMIDI_Transport &setName(const char *deviceName)
|
BLEMIDI_Transport &setName(const char *deviceName)
|
||||||
|
|
@ -199,6 +200,12 @@ public:
|
||||||
_connectedCallback = fptr;
|
_connectedCallback = fptr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BLEMIDI_Transport &setHandleConnected(void (*fptr)(char*))
|
||||||
|
{
|
||||||
|
_connectedCallbackDeviceName= fptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
BLEMIDI_Transport &setHandleDisconnected(void (*fptr)())
|
BLEMIDI_Transport &setHandleDisconnected(void (*fptr)())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,8 @@ private:
|
||||||
BLERemoteCharacteristic *_characteristic = nullptr;
|
BLERemoteCharacteristic *_characteristic = nullptr;
|
||||||
BLERemoteService *pSvc = nullptr;
|
BLERemoteService *pSvc = nullptr;
|
||||||
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.
|
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.
|
||||||
|
char connectedDeviceName[24];
|
||||||
|
|
||||||
BLEMIDI_Transport<class BLEMIDI_Client_ESP32> *_bleMidiTransport = nullptr;
|
BLEMIDI_Transport<class BLEMIDI_Client_ESP32> *_bleMidiTransport = nullptr;
|
||||||
|
|
||||||
bool specificTarget = false;
|
bool specificTarget = false;
|
||||||
|
|
@ -303,6 +304,12 @@ protected:
|
||||||
_bleMidiTransport->_connectedCallback();
|
_bleMidiTransport->_connectedCallback();
|
||||||
}
|
}
|
||||||
firstTimeSend = true;
|
firstTimeSend = true;
|
||||||
|
|
||||||
|
if (_bleMidiTransport->_connectedCallbackDeviceName)
|
||||||
|
{
|
||||||
|
sprintf(connectedDeviceName, "%s", myAdvCB.advDevice.getName().c_str());
|
||||||
|
_bleMidiTransport->_connectedCallbackDeviceName(connectedDeviceName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disconnected()
|
void disconnected()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue