Getting A specific part from an output

Hello.

I used "ble sniffer" code from github to sniff the mac address the output which i am getting in the form of key value pair.
like this

Name: , Address: 48:ce:cb:54:50:6f, manufacturer data: 060001092002c170d572f663f4447d069d77f286101b7c99b241939980

And I am printing through

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    void onResult(BLEAdvertisedDevice advertisedDevice) {
      //Serial.printf("Advertised Device: %s \n", advertisedDevice.toString().c_str());
      Serial.println(advertisedDevice.toString().Address());
    }
};

So, I only need to capture an address and no other stuff like manufacturer data and other things

You can see raw code here:- ESP32_BLE_Arduino/BLE_scan.ino at master · nkolban/ESP32_BLE_Arduino (github.com)

Thank You

What’s your question?

Did you look at what’s available form a BLEAdvertisedDevice ?

At this part:

advertisedDevice.toString().Address()

You'll need to get the address before converting it to a string, so the order should be:

advertisedDevice.Address().toString()

But the documentation says to use the getAddress() method to get the address so maybe try this:

advertisedDevice.getAddress().toString()