ESP32_BLE_Arduino
ESP32_BLE_Arduino copied to clipboard
Alter library so it can handle multiple service data
This is not very clear in the documentation but I needed to add several AD Structures with the type SERVICE_DATA in one of my project. In order to get those several service data back with your library I had to change it a little... Maybe others can benefit from this modification Fred
+1 for this PR to merge - it allows to work with Xiaomi Mijia thermo/hygrometer. Thanks @fguiet for doing this.
Using this patch, I was able to work around the Xiaomi Mijia issue. As it is, it changes slightly the functions signatures but using std::string BLEAdvertisedDevice::getServiceData(int i=0) and BLEUUID BLEAdvertisedDevice::getServiceDataUUID(int i=0) avoids breakage while solving the problem.
Thanks for this. I confirm that with new Mijia indoor temperature and humidity sensor we need to be able to read several service data. This PR answer to this need. It will be very nice if this PR could be integrated to the main repository.
This PR surely works with MJ_HT_V1, but introduce a small issue for LYWSD02 - another similar meter with clock from the same company.
With this, device name for LYWSD02 is always empty, but with current ESP32 Arduino library and Nordic nRF Connect all see its name "LYWSD02".
Can this be merged ? It works flawless with latest lib, no more problem with empty names. I'm using it in one of my project,solved all my issues