Trouble getting the iBeacon RawData from advertisedDevice in BLE

LucasSossai
Posts: 4
Joined: Tue Dec 04, 2018 5:45 pm

Trouble getting the iBeacon RawData from advertisedDevice in BLE

Postby LucasSossai » Fri Jan 18, 2019 12:55 am

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?

Who is online

Users browsing this forum: No registered users and 80 guests