I wanted to use the library BLE mouse to use with my esp 32, and with the Arduino IDE that was just what i needed to run it, but why i need to install this other library to run it with vs code in platformIO?
Do you have a #include <BleMouse.h>
in the src/main.cpp
? PlatformIO will not detect sub-dependencies of a library if you don’t include it in your sketch.
The library that it depends on is framework-internal (arduino-esp32/libraries/BLE/src at master · espressif/arduino-esp32 · GitHub ), so no further install should be necessary.
But my program can’t finish the processed and fails, so what should i do to fix it?
Here, the full error message
Please show the full platformio.ini
and src/
files.
Can you please try this and try building again.
Ok, now i included, saved and then it worked. The first time i included it didn’t work, but i guess i forgot to save it. Thanks a lot and sorry to bother
Don’t use a 2 year old library with the latest Arduino-ESP32 3.x core. Or use a fixed version of the library.
T-vK:master
← robosphere99:master
opened 01:31PM - 11 Dec 24 UTC
This pull request resolves compatibility issues in the ESP32_BLE_Mouse library, … ensuring smoother integration and functionality with Arduino functions that require the String type. The following fixes were implemented:
Key Changes:
BLEDevice::init():
Fixed a type mismatch by converting std::string to String using .c_str().
Updated line 143 in BleMouse.cpp:
cpp
Copy code
BLEDevice::init(String(bleMouseInstance->deviceName.c_str()));
BLECharacteristic::setValue():
Resolved a similar issue by converting std::string to String.
Updated line 151 in BleMouse.cpp:
bleMouseInstance->hid->manufacturer()->setValue(String(bleMouseInstance->deviceManufacturer.c_str()));
**Reason for Changes:**
The library was originally passing std::string (C++ Standard Library) to functions that require String (Arduino-specific type). This caused compilation errors on Arduino platforms. These changes ensure type compatibility and make the library fully functional without modifying the user's project code.
**Testing:**
Verified the fixes on an ESP32-based project.
Ensured smooth initialization of BLE and successful updates to the characteristic values.
Tested with multiple BLE devices and ensured backward compatibility.
**Impact:**
Fixes critical compilation issues caused by type mismatches.
Ensures seamless use of the library on the latest ESP32 Arduino Core.
No breaking changes introduced.
**Recommendation to Maintainers:**
Consider adding explicit support for std::string in future versions for broader compatibility.