frowin/LunarGateway

own BLE Mac Address

Closed this issue · 1 comments

St-fn commented

Currently I am not able to get my BL Mac Address. Tried to use with Iphone but I didnt have the "Info" button on Bluetooth Menu

Thanks

St-fn commented

I changed the code to view Mac-Address

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
void onResult(BLEAdvertisedDevice advertisedDevice) {
Serial.print("Gefundenes Gerät: ");
Serial.print(advertisedDevice.getName().c_str());
Serial.print(" | MAC: ");
Serial.println(advertisedDevice.getAddress().toString().c_str());

if (advertisedDevice.getAddress().toString() == BLE_MAC) {
  BLEDevice::getScan()->stop();
  myDevice = new BLEAdvertisedDevice(advertisedDevice);
  doConnect = true;
  doScan = true;
}

}
};