ESP32_BLE_Arduino icon indicating copy to clipboard operation
ESP32_BLE_Arduino copied to clipboard

Alter library so it can handle multiple service data

Open fguiet opened this issue 6 years ago • 5 comments

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

fguiet avatar Dec 16 '18 20:12 fguiet

+1 for this PR to merge - it allows to work with Xiaomi Mijia thermo/hygrometer. Thanks @fguiet for doing this.

Pablo2048 avatar Feb 03 '19 09:02 Pablo2048

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.

guillier avatar Mar 04 '19 09:03 guillier

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.

1technophile avatar May 30 '19 11:05 1technophile

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".

eos1d3 avatar Jul 07 '19 03:07 eos1d3

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

KipK avatar Aug 07 '19 14:08 KipK