Function esp_idf_hal::sys::esp_wifi_set_mac

source ·
pub unsafe extern "C" fn esp_wifi_set_mac(
    ifx: u32,
    mac: *const u8,
) -> i32
Expand description

@brief Set MAC address of WiFi station, soft-AP or NAN interface.

@attention 1. This API can only be called when the interface is disabled @attention 2. Above mentioned interfaces have different MAC addresses, do not set them to be the same. @attention 3. The bit 0 of the first byte of MAC address can not be 1. For example, the MAC address can set to be “1a:XX:XX:XX:XX:XX”, but can not be “15:XX:XX:XX:XX:XX”.

@param ifx interface @param mac the MAC address

@return

  • ESP_OK: succeed
  • ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
  • ESP_ERR_INVALID_ARG: invalid argument
  • ESP_ERR_WIFI_IF: invalid interface
  • ESP_ERR_WIFI_MAC: invalid mac address
  • ESP_ERR_WIFI_MODE: WiFi mode is wrong
  • others: refer to error codes in esp_err.h