I am using the ESP32 BLE Arduino -> BLE_IBeacon example in Arduino IDE and would like to be able to change the MAC-Address of the advertising device after I initialized the BLEDevice.
Right now it looks like this:
Code: Select all
uint8_t new_mac[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
esp_base_mac_addr_set(new_mac);
BLEDevice::init("ESP32");
BLEDevice::startAdvertising();
Code: Select all
esp_base_mac_addr_set(new_mac);
Code: Select all
ESP.restart();
I know it is possible, because
https://docs.espressif.com/projects/esp ... m-base-mac
says "It is also possible to call the function esp_netif_set_mac() to set the specific MAC used by a network interface, after network initialization.", but I can't make it work.
I tried including the necessary libraries and using esp_netif_set_mac(), but I don't know how to get the esp_netif Parameter.
Can someone help me or show me a working example please?