title: Unable to retrieve iBeacon UUID (ESP32 BLE Scanner)
body: <p>I have been using the ESP32 to scan for nearby iBeacon but I was unable to retrieve the UUID of beacons. The serial monitor keeps displaying "N/a". However, I was able to get the UUIDs of beacons when using the normal android BLE scanner app. Is there anything missing in my code? </p>
  
  <pre><code>/*
     Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp
     Ported to Arduino ESP32 by Evandro Copercini
  */
  
  #include &lt;BLEDevice.h&gt;
  #include &lt;BLEUtils.h&gt;
  #include &lt;BLEScan.h&gt;
  #include &lt;BLEUUID.h&gt;
  #include &lt;BLEAdvertisedDevice.h&gt;
  
  BLEScan* pBLEScan;
  
  int scanTime = 5; //In seconds
  class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks 
  {
      void onResult(BLEAdvertisedDevice advertisedDevice) 
      {
        //Print Name
        Serial.print("Name :");
        if (advertisedDevice.haveName())
        {
        Serial.println(advertisedDevice.getName().c_str());
        }
        else
        {
          Serial.println("N/a");
        }
  
        //Print RSSI
        Serial.print("RSSI :");
        Serial.println(advertisedDevice.getRSSI());
  
        //Print UUID
        Serial.print("UUID :");
        if (advertisedDevice.haveServiceUUID())
        {        
          Serial.println(advertisedDevice.getServiceUUID().toString().c_str());
        }
        else
        {
          Serial.println("N/a");
        }
        Serial.println("");  
      }
  
  };
  
  
  void setup() {
    Serial.begin(115200);
    Serial.println("Scanning...");
  }
  
  void loop() {
    BLEDevice::init("");
    pBLEScan = BLEDevice::getScan(); //create new scan
    pBLEScan-&gt;setActiveScan(true); //active scan uses more power, but get results faster
    pBLEScan-&gt;setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
    BLEScanResults foundDevices = pBLEScan-&gt;start(scanTime);
    Serial.print("Devices found: ");
    Serial.println(foundDevices.getCount());
    Serial.println("Scan done!");
  
    delay(1000);
  }
  </code></pre>