mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_wifi: Modify ESP_IF_WIFI_AP to WIFI_IF_AP
This commit is contained in:
parent
ee2b8a65a0
commit
1975d39d44
@ -209,8 +209,8 @@ esp_err_t system_event_ap_start_handle_default(system_event_t *event)
|
||||
tcpip_adapter_ip_info_t ap_ip;
|
||||
uint8_t ap_mac[6];
|
||||
|
||||
WIFI_API_CALL_CHECK("esp_wifi_internal_reg_rxcb", esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, (wifi_rxcb_t)tcpip_adapter_ap_input), ESP_OK);
|
||||
WIFI_API_CALL_CHECK("esp_wifi_mac_get", esp_wifi_get_mac(ESP_IF_WIFI_AP, ap_mac), ESP_OK);
|
||||
WIFI_API_CALL_CHECK("esp_wifi_internal_reg_rxcb", esp_wifi_internal_reg_rxcb(WIFI_IF_AP, (wifi_rxcb_t)tcpip_adapter_ap_input), ESP_OK);
|
||||
WIFI_API_CALL_CHECK("esp_wifi_mac_get", esp_wifi_get_mac(WIFI_IF_AP, ap_mac), ESP_OK);
|
||||
|
||||
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ap_ip);
|
||||
tcpip_adapter_ap_start(ap_mac, &ap_ip);
|
||||
@ -220,7 +220,7 @@ esp_err_t system_event_ap_start_handle_default(system_event_t *event)
|
||||
|
||||
esp_err_t system_event_ap_stop_handle_default(system_event_t *event)
|
||||
{
|
||||
WIFI_API_CALL_CHECK("esp_wifi_internal_reg_rxcb", esp_wifi_internal_reg_rxcb(ESP_IF_WIFI_AP, NULL), ESP_OK);
|
||||
WIFI_API_CALL_CHECK("esp_wifi_internal_reg_rxcb", esp_wifi_internal_reg_rxcb(WIFI_IF_AP, NULL), ESP_OK);
|
||||
|
||||
tcpip_adapter_stop(TCPIP_ADAPTER_IF_AP);
|
||||
|
||||
|
@ -238,7 +238,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();
|
||||
@ -299,7 +299,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);
|
||||
|
@ -329,7 +329,7 @@ static u8_t *add_offer_options(u8_t *optptr)
|
||||
//bzero(&if_ip, sizeof(struct ip_info));
|
||||
memset(&if_ip , 0x00, sizeof(tcpip_adapter_ip_info_t));
|
||||
|
||||
tcpip_adapter_get_ip_info(ESP_IF_WIFI_AP, &if_ip);
|
||||
tcpip_adapter_get_ip_info(WIFI_IF_AP, &if_ip);
|
||||
|
||||
if (!ip4_addr_isany_val(if_ip.gw)) {
|
||||
*optptr++ = DHCP_OPTION_ROUTER;
|
||||
|
@ -84,4 +84,4 @@ void dhcp_ip_addr_erase(void *netif)
|
||||
nvs_close(nvs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -683,7 +683,7 @@ esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_dhcp_option_mode_t opt_op, tc
|
||||
|
||||
if (poll->enable) {
|
||||
memset(&info, 0x00, sizeof(tcpip_adapter_ip_info_t));
|
||||
tcpip_adapter_get_ip_info(ESP_IF_WIFI_AP, &info);
|
||||
tcpip_adapter_get_ip_info(WIFI_IF_AP, &info);
|
||||
softap_ip = htonl(info.ip.addr);
|
||||
start_ip = htonl(poll->start_ip.addr);
|
||||
end_ip = htonl(poll->end_ip.addr);
|
||||
@ -854,7 +854,7 @@ esp_err_t tcpip_adapter_dhcps_start(tcpip_adapter_if_t tcpip_if)
|
||||
|
||||
if (p_netif != NULL && netif_is_up(p_netif)) {
|
||||
tcpip_adapter_ip_info_t default_ip;
|
||||
tcpip_adapter_get_ip_info(ESP_IF_WIFI_AP, &default_ip);
|
||||
tcpip_adapter_get_ip_info(WIFI_IF_AP, &default_ip);
|
||||
dhcps_set_new_lease_cb(tcpip_adapter_dhcps_cb);
|
||||
dhcps_start(p_netif, default_ip.ip);
|
||||
dhcps_status = TCPIP_ADAPTER_DHCP_STARTED;
|
||||
|
@ -60,7 +60,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;
|
||||
|
@ -227,7 +227,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;
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,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;
|
||||
|
@ -329,7 +329,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;
|
||||
|
@ -77,7 +77,7 @@ void wifi_init_softap()
|
||||
}
|
||||
|
||||
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",
|
||||
|
@ -221,7 +221,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user