-
Notifications
You must be signed in to change notification settings - Fork 36
Adaptation to new NimBLE lib methods. #102
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
base: CustomSettings
Are you sure you want to change the base?
Conversation
Will check later this week and report back after hardware testing. |
@RobertoHE |
@RobertoHE just wondering if you can steer me in the right direction here please |
Apart from the changes here I also did these: diff --git a/src/hardware/BLEMIDI_Client_ESP32.h b/src/hardware/BLEMIDI_Client_ESP32.h
index b16dd48..8f2c5dc 100644
--- a/src/hardware/BLEMIDI_Client_ESP32.h
+++ b/src/hardware/BLEMIDI_Client_ESP32.h
@@ -149,7 +149,7 @@ public:
std::string nameTarget;
protected:
- void onResult(NimBLEAdvertisedDevice *advertisedDevice)
+ void onResult(const NimBLEAdvertisedDevice *advertisedDevice)
{
if (!enableConnection) // not begin() or end()
{
diff --git a/src/hardware/BLEMIDI_ESP32_NimBLE.h b/src/hardware/BLEMIDI_ESP32_NimBLE.h
index 6914a00..9a4c3d1 100644
--- a/src/hardware/BLEMIDI_ESP32_NimBLE.h
+++ b/src/hardware/BLEMIDI_ESP32_NimBLE.h
@@ -82,13 +82,13 @@ public:
protected:
BLEMIDI_ESP32_NimBLE<_Settings> *_bluetoothEsp32 = nullptr;
- void onConnect(BLEServer *)
+ void onConnect(BLEServer *, NimBLEConnInfo &)
{
if (_bluetoothEsp32)
_bluetoothEsp32->connected();
};
- void onDisconnect(BLEServer *)
+ void onDisconnect(BLEServer *, NimBLEConnInfo &, int)
{
if (_bluetoothEsp32)
_bluetoothEsp32->disconnected();
@@ -107,7 +107,7 @@ public:
protected:
BLEMIDI_ESP32_NimBLE<_Settings> *_bluetoothEsp32 = nullptr;
- void onWrite(BLECharacteristic *characteristic)
+ void onWrite(BLECharacteristic *characteristic, NimBLEConnInfo &)
{
std::string rxValue = characteristic->getValue();
if (rxValue.length() > 0)
@@ -173,6 +173,7 @@ bool BLEMIDI_ESP32_NimBLE<_Settings>::begin(const char *deviceName, BLEMIDI_Tran
_advertising = _server->getAdvertising();
_advertising->addServiceUUID(service->getUUID());
_advertising->setAppearance(0x00);
+ _advertising->setName(deviceName);
_advertising->start();
return true; Everything seems to be working fine (at least for my use case) on ESP32-C6. @samspencer5991 I don't think those errors are related to these changes. |
@samspencer5991 @nforro @lathoub @MicroMidi @jhsa. Please, check it. |
Thx @RobertoHE have other been able to test? @nforro @MicroMidi @samspencer5991 |
I have updated the method names following the migration guide. You can find it here: https://github.com/h2zero/NimBLE-Arduino/blob/62180ab2bc9c9a8b41f9fb800ea7256e89628a3a/docs/1.x_to2.x_migration_guide.md?plain=1#L132
Please note that these changes have only been compiled without errors and have not been tested with hardware (I haven't any ESP32 now).
This pull request is intended as a hotfix. I will need additional time to update the other transport layers.
@lathoub , could you please review this pull request before it is merged?
Please, add other users to this theat that may be involved with the lib and what they may test with real hardware.