Page 1 of 1

Trouble getting the iBeacon RawData from advertisedDevice in BLE

Posted: Fri Jan 18, 2019 12:55 am
by LucasSossai
Hello everyone,

I'm trying to read the raw data that my iBeacon is advertising,
When I'm scanning MyCallback:

Code: Select all

class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
{
  void onResult(BLEAdvertisedDevice advertisedDevice)
  {
    Serial.printf("\n Advertised Device: %s \n", advertisedDevice.toString().c_str());
    Serial.printf("Advertised getPayloadLength: %d  \n", advertisedDevice.getPayloadLength());
    
  }
};
Have the advertisedDevice object with getPayLoad() which returns me a uint8_t * pointer and the method getPayLoadLength() which returns the size_t of the payload ( 31 bytes ), I'm not able to reconstruct the whole payload, can anyone give me some ideas? Is this the correct way to get the raw data from the advertisedDevice?