Function esp_idf_hal::sys::esp_wifi_init

source ·
pub unsafe extern "C" fn esp_wifi_init(
    config: *const wifi_init_config_t,
) -> i32
Expand description

@brief Initialize WiFi Allocate resource for WiFi driver, such as WiFi control structure, RX/TX buffer, WiFi NVS structure etc. This WiFi also starts WiFi task

@attention 1. This API must be called before all other WiFi API can be called @attention 2. Always use WIFI_INIT_CONFIG_DEFAULT macro to initialize the configuration to default values, this can guarantee all the fields get correct value when more fields are added into wifi_init_config_t in future release. If you want to set your own initial values, overwrite the default values which are set by WIFI_INIT_CONFIG_DEFAULT. Please be notified that the field ‘magic’ of wifi_init_config_t should always be WIFI_INIT_CONFIG_MAGIC!

@param config pointer to WiFi initialized configuration structure; can point to a temporary variable.

@return

  • ESP_OK: succeed
  • ESP_ERR_NO_MEM: out of memory
  • others: refer to error code esp_err.h