espressif / esp-iot-bridge

A smart bridge to make both ESP and the other MCU or smart device can access the Internet.
Apache License 2.0
140 stars 49 forks source link

How do I change the MAC address for my WiFi station? (AEGHB-21) #32

Open edbek opened 1 year ago

edbek commented 1 year ago

For the example project "wifi_router" in the function "esp_bridge_create_station_netif()" there is a parameter "uint8_t mac[6]", which is intended to change the MAC address of the my WiFi station (CONFIG_BRIDGE_EXTERNAL_NETIF_STATION is enabled). But in the function itself, this parameter is not used. That is, it is impossible to change the MAC address of the WiFi station in this way.

Then how can you change the MAC address?

tswen commented 1 year ago

You can call esp_netif_set_mac interface to change mac after creating station_netif.