Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptation to new NimBLE lib methods. #102

Open
wants to merge 1 commit into
base: CustomSettings
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/hardware/BLEMIDI_Client_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
};

/** Define a class to handle the callbacks when advertisments are received */
class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
class AdvertisedDeviceCallbacks : public NimBLEScanCallbacks
{
public:
NimBLEAdvertisedDevice advDevice;
Expand All @@ -165,7 +165,7 @@ class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
}

DEBUGCLIENT("Found MIDI Service");
if (!(!specificTarget || (advertisedDevice->getName() == nameTarget.c_str() || advertisedDevice->getAddress() == nameTarget)))
if (!(!specificTarget || (advertisedDevice->getName() == nameTarget.c_str() || advertisedDevice->getAddress().toString() == nameTarget)))
{
DEBUGCLIENT("Name error");
return;
Expand Down Expand Up @@ -450,7 +450,7 @@ void BLEMIDI_Client_ESP32<_Settings>::scan()
NimBLEScan *pBLEScan = BLEDevice::getScan();
if (!pBLEScan->isScanning())
{
pBLEScan->setAdvertisedDeviceCallbacks(&myAdvCB);
pBLEScan->setScanCallbacks(&myAdvCB);
pBLEScan->setInterval(600);
pBLEScan->setWindow(500);
pBLEScan->setActiveScan(true);
Expand Down Expand Up @@ -501,7 +501,7 @@ bool BLEMIDI_Client_ESP32<_Settings>::connect()
}
}

if (NimBLEDevice::getClientListSize() >= NIMBLE_MAX_CONNECTIONS)
if (NimBLEDevice::getCreatedClientCount() >= NIMBLE_MAX_CONNECTIONS)
{
DEBUGCLIENT("Max clients reached - no more connections available");
return false;
Expand Down
Loading