Hello,
Im currently working with ESP32S3 Feather and ELA beacons. I need to read data from this beacons. Temperature and humidity. In addition, they provide information about battery voltage/battery level in %. But problem is that, Im able to get first data, which is temperature and humidity, its in one frame. But there is second frame, where information about battery is stored and I cant get this data. Both frames are set as manufacturer data, but with function to get manufacturer data I only get first frame with temp. and humidity data.
class MyAdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
{
void onResult(NimBLEAdvertisedDevice *advertisedDevice)
{
char *p = NimBLEUtils::buildHexData(nullptr, (uint8_t *)advertisedDevice->getManufacturerData().data(), advertisedDevice->getManufacturerData().length());
if (advertisedDevice->getManufacturerData().length() == 7 && sensorCount < sensorDeclared)
{
char humidArray[3] = {p[6], p[7], 0};
humidity = strtol(humidArray, nullptr, 16);
char tempArray[5] = {p[12], p[13], p[10], p[11], 0};
temperature = (strtol(tempArray, nullptr, 16)) * 0.01;
strcpy(sensorName, advertisedDevice->getName().c_str());
free(p);
Serial.println(sensorName);
}
}
};
With this code I get only first frame. Anyone could help, how to get this second frame with battery level?