-
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 |
Hi, I tried compiling the Sketch "MidiBle_Client.ino" for the ESP32-S3 board, but it does not compile. I am using IDE 2.3.5. Here is the error:
|
Do you use the branch or main repo? |
Well, I have just reinstalled the library using the IDE itself. Shall I do it differently? |
I have just installed version 2.1.0 of the library using the arduino IDE, tried to compile the sketch "MidiBle.ino" for ESP32-S3 with "#include <hardware/BLEMIDI_ESP32_NimBLE.h>" selected and it did compile. I still don't know if it actually works. But at least it did compile. |
You are using the main repo without request changes. You must use pull request code. |
So, manual installation then. |
If you use Platformio, you can use something like this in platformio.ini: In Arduino IDE, you must select the PR code (for example, my repo and CustomSetting Branch ), download the code ( Code -> Download as zip), and install it manually in Arduino (copy files to the Arduino path and reload the IDE). |
Ok, Thanks RobertoHE, I am trying to improve an old project and it wasn't compiling anymore. I think the ESP32 core changed and as far as I understand libraries will have to adapt to it, otherwise they won't work anymore, at least some of them. Will try this asap. It might take a couple days.. |
Remove redundance declarations
…iles for consistency and improved configuration options.
@lathoub. The Auto Test script has a little problem, if you try to compile Arduino-BLE lib and ESP-BLE libs on the same computer, because they have incompatible methods. If I only include the Hardware transport layer of ESP-BLE lib ( Except for this one, I compile every code with every hardware layer manually, and everything compiles fine. I can't test them in functionality because I don't have hardware now, but I can suppose that they can work fine. Additionally, I unified all configuration methods by hierarchy ( MIDI -> BLE_MIDI -> BLE_Transport Layer). You can configure MIDI and BLE with the same structure configuration. I refactored some example code to illustrate that. |
I think that the CustomSettings branch (configuration capabilities of MIDI and BLEMIDI) can merge as the master branch. In my opinion, this method of configuration transport layer and MIDI functionality is more flexible, adaptive, and easy to use than the master branch. |
Great work, i will try on my end. @ all: please check as well |
I am testing your library on my older project and the devices is being recognized as "Unknown Device" by my android smartphone. Am I doing something wrong?
|
Tried also with a normal "ESP32 board "DOIT ESP32 DEVKIT V1" and am having the same behavior. |
@jhsa For the Sorry, I haven't been able to test the code changes yet. |
what file is that? Can't find it.. |
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.