Skip to content

Commit d728f00

Browse files
RobertoHERobertoHE
RobertoHE
authored and
RobertoHE
committed
Adaptation to new NimBLE lib methods.
1 parent 38fea5d commit d728f00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hardware/BLEMIDI_Client_ESP32.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
138138
};
139139

140140
/** Define a class to handle the callbacks when advertisments are received */
141-
class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
141+
class AdvertisedDeviceCallbacks : public NimBLEScanCallbacks
142142
{
143143
public:
144144
NimBLEAdvertisedDevice advDevice;
@@ -165,7 +165,7 @@ class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
165165
}
166166

167167
DEBUGCLIENT("Found MIDI Service");
168-
if (!(!specificTarget || (advertisedDevice->getName() == nameTarget.c_str() || advertisedDevice->getAddress() == nameTarget)))
168+
if (!(!specificTarget || (advertisedDevice->getName() == nameTarget.c_str() || advertisedDevice->getAddress().toString() == nameTarget)))
169169
{
170170
DEBUGCLIENT("Name error");
171171
return;
@@ -450,7 +450,7 @@ void BLEMIDI_Client_ESP32<_Settings>::scan()
450450
NimBLEScan *pBLEScan = BLEDevice::getScan();
451451
if (!pBLEScan->isScanning())
452452
{
453-
pBLEScan->setAdvertisedDeviceCallbacks(&myAdvCB);
453+
pBLEScan->setScanCallbacks(&myAdvCB);
454454
pBLEScan->setInterval(600);
455455
pBLEScan->setWindow(500);
456456
pBLEScan->setActiveScan(true);
@@ -501,7 +501,7 @@ bool BLEMIDI_Client_ESP32<_Settings>::connect()
501501
}
502502
}
503503

504-
if (NimBLEDevice::getClientListSize() >= NIMBLE_MAX_CONNECTIONS)
504+
if (NimBLEDevice::getCreatedClientCount() >= NIMBLE_MAX_CONNECTIONS)
505505
{
506506
DEBUGCLIENT("Max clients reached - no more connections available");
507507
return false;

0 commit comments

Comments
 (0)