mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
esp_wifi: Modify ESP_IF_WIFI_AP to WIFI_IF_AP
This commit is contained in:
@@ -267,7 +267,7 @@ static void send_ds2ds_packet(void)
|
||||
|
||||
// send packet 20 times to make sure receiver will get this packet
|
||||
for (uint16_t i = 0; i < 20; i++) {
|
||||
esp_wifi_80211_tx(ESP_IF_WIFI_AP, ds2ds_pdu, sizeof(ds2ds_pdu), true);
|
||||
esp_wifi_80211_tx(WIFI_IF_AP, ds2ds_pdu, sizeof(ds2ds_pdu), true);
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
}
|
||||
stop_wifi();
|
||||
@@ -329,7 +329,7 @@ static void test_wifi_connection_softap(void)
|
||||
|
||||
start_wifi_as_softap();
|
||||
|
||||
TEST_ESP_OK(esp_wifi_get_mac(ESP_IF_WIFI_AP, mac));
|
||||
TEST_ESP_OK(esp_wifi_get_mac(WIFI_IF_AP, mac));
|
||||
sprintf(mac_str, MACSTR, MAC2STR(mac));
|
||||
|
||||
unity_send_signal_param("SoftAP mac", mac_str);
|
||||
|
@@ -63,7 +63,7 @@ static esp_err_t start_wifi_ap(const char *ssid, const char *pass)
|
||||
ESP_LOGE(TAG, "Failed to set Wi-Fi mode : %d", err);
|
||||
return err;
|
||||
}
|
||||
err = esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config);
|
||||
err = esp_wifi_set_config(WIFI_IF_AP, &wifi_config);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to set Wi-Fi config : %d", err);
|
||||
return err;
|
||||
|
@@ -246,7 +246,7 @@ static bool wifi_cmd_ap_set(const char *ssid, const char *pass)
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,7 @@ static void eth2wifi_flow_control_task(void *args)
|
||||
do {
|
||||
vTaskDelay(pdMS_TO_TICKS(timeout));
|
||||
timeout += 2;
|
||||
res = esp_wifi_internal_tx(ESP_IF_WIFI_AP, msg.packet, msg.length);
|
||||
res = esp_wifi_internal_tx(WIFI_IF_AP, msg.packet, msg.length);
|
||||
} while (res && timeout < FLOW_CONTROL_WIFI_SEND_TIMEOUT_MS);
|
||||
if (res != ESP_OK) {
|
||||
ESP_LOGE(TAG, "WiFi send packet failed: %d", res);
|
||||
@@ -128,12 +128,12 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base,
|
||||
case WIFI_EVENT_AP_STACONNECTED:
|
||||
ESP_LOGI(TAG, "Wi-Fi AP got a station connected");
|
||||
s_sta_is_connected = true;
|
||||
esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, pkt_wifi2eth);
|
||||
esp_wifi_internal_reg_rxcb(WIFI_IF_AP, pkt_wifi2eth);
|
||||
break;
|
||||
case WIFI_EVENT_AP_STADISCONNECTED:
|
||||
ESP_LOGI(TAG, "Wi-Fi AP got a station disconnected");
|
||||
s_sta_is_connected = false;
|
||||
esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, NULL);
|
||||
esp_wifi_internal_reg_rxcb(WIFI_IF_AP, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -212,7 +212,7 @@ static void initialize_wifi(void)
|
||||
wifi_config.ap.authmode = WIFI_AUTH_OPEN;
|
||||
}
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
|
||||
}
|
||||
|
||||
static esp_err_t initialize_flow_control(void)
|
||||
|
@@ -319,7 +319,7 @@ static esp_err_t start_wifi_ap(const char *ssid, const char *pass)
|
||||
ESP_LOGE(TAG, "Failed to set WiFi mode : %d", err);
|
||||
return err;
|
||||
}
|
||||
err = esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config);
|
||||
err = esp_wifi_set_config(WIFI_IF_AP, &wifi_config);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to set WiFi config : %d", err);
|
||||
return err;
|
||||
|
@@ -305,7 +305,7 @@ static esp_err_t start_wifi_ap(const char *ssid, const char *pass)
|
||||
ESP_LOGE(TAG, "Failed to set WiFi mode : %d", err);
|
||||
return err;
|
||||
}
|
||||
err = esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config);
|
||||
err = esp_wifi_set_config(WIFI_IF_AP, &wifi_config);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to set WiFi config : %d", err);
|
||||
return err;
|
||||
|
@@ -70,7 +70,7 @@ void wifi_init_softap(void)
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
|
||||
ESP_ERROR_CHECK(esp_wifi_start());
|
||||
|
||||
ESP_LOGI(TAG, "wifi_init_softap finished. SSID:%s password:%s channel:%d",
|
||||
|
@@ -231,7 +231,7 @@ static bool wifi_cmd_ap_set(const char* ssid, const char* pass)
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config));
|
||||
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user