@@ -138,7 +138,7 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
138
138
};
139
139
140
140
/* * Define a class to handle the callbacks when advertisments are received */
141
- class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
141
+ class AdvertisedDeviceCallbacks : public NimBLEScanCallbacks
142
142
{
143
143
public:
144
144
NimBLEAdvertisedDevice advDevice;
@@ -165,7 +165,7 @@ class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
165
165
}
166
166
167
167
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)))
169
169
{
170
170
DEBUGCLIENT (" Name error" );
171
171
return ;
@@ -450,7 +450,7 @@ void BLEMIDI_Client_ESP32<_Settings>::scan()
450
450
NimBLEScan *pBLEScan = BLEDevice::getScan ();
451
451
if (!pBLEScan->isScanning ())
452
452
{
453
- pBLEScan->setAdvertisedDeviceCallbacks (&myAdvCB);
453
+ pBLEScan->setScanCallbacks (&myAdvCB);
454
454
pBLEScan->setInterval (600 );
455
455
pBLEScan->setWindow (500 );
456
456
pBLEScan->setActiveScan (true );
@@ -501,7 +501,7 @@ bool BLEMIDI_Client_ESP32<_Settings>::connect()
501
501
}
502
502
}
503
503
504
- if (NimBLEDevice::getClientListSize () >= NIMBLE_MAX_CONNECTIONS)
504
+ if (NimBLEDevice::getCreatedClientCount () >= NIMBLE_MAX_CONNECTIONS)
505
505
{
506
506
DEBUGCLIENT (" Max clients reached - no more connections available" );
507
507
return false ;
0 commit comments