esp_netif_dns_info_t dns; if (esp_netif_get_dns_info(_esp_netif_sta, ESP_NETIF_DNS_MAIN, &dns) == ESP_OK) { dhcps_dns_setserver((const ip_addr_t *)&dns.ip); ESP_LOGI(TAG, "set dns to:" IPSTR, IP2STR(&dns.ip.u_addr.ip4)); } } static void wifi_init_softap(void)...
}staticvoidgot_ip_handler(void* arg,esp_event_base_tevent_base,int32_tevent_id,void* event_data){//No need to log, wifi driver logs automaticallyesp_netif_dns_info_tdns;if(esp_netif_get_dns_info(_esp_netif_sta, ESP_NETIF_DNS_MAIN, &dns) == ESP_OK) { dhcps_dns_setserver((con...
esp_netif_get_hostname(esp_netif_t *esp_netif, const char **hostname); //获取当前主机名 esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info); //获取当前IP地址相关信息 esp_netif_set_ip_info(esp_netif_t *esp_netif, const esp_netif_ip_info_t *ip_info...
"NETIF_PPP_CONNECT_FAILED"); } } static void on_ip_event(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { ESP_LOGD(TAG, "IP event! %d", event_id); if (event_id == IP_EVENT_PPP_GOT_IP) { esp_netif_dns_info_t...
Both use the same DNS server. When I use DHCP mode, the getaddrinfo() queries return just fine. Code: Select all // setting DNS to 8.8.8.8 esp_netif_dns_info_t dns_info; dns_info.ip.u_addr.ip4.addr = swap32bytes(sysConf.eth_dns); esp_netif_set_dns_info(my_eth_netif,ESP_...
esp_netif_dns_info_t dnsserver; // esp_netif_dns_info_t dnsinfo;wifi_event_group = xEventGroupCreate();esp_netif_init(); ESP_ERROR_CHECK(esp_event_loop_create_default()); wifiAP = esp_netif_create_default_wifi_ap(); wifiSTA = esp_netif_create_default_wifi_sta();esp...
ESP_ERROR_CHECK(esp_netif_init()); // 创建默认事件循环。 ESP_ERROR_CHECK(esp_event_loop_create_default()); // 创建默认的Wi-Fi网络接口。 esp_netif_create_default_wifi_sta(); // 设置 Wi-Fi 初始化配置为默认配置 wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(...
//设置当前主机名esp_netif_get_hostname(esp_netif_t*esp_netif,constchar**hostname);//获取当前主机名esp_netif_get_ip_info(esp_netif_t*esp_netif,esp_netif_ip_info_t*ip_info);//获取当前IP地址相关信息esp_netif_set_ip_info(esp_netif_t*esp_netif,constesp_netif_ip_info_t*ip_info);//...
esp_netif_dns_info_tgdns1, gdns2, gdns3;ESP_ERROR_CHECK(esp_netif_get_dns_info(eth_netif, ESP_NETIF_DNS_MAIN, &gdns1));ESP_ERROR_CHECK(esp_netif_get_dns_info(eth_netif, ESP_NETIF_DNS_BACKUP, &gdns2));ESP_ERROR_CHECK(esp_netif_get_dns_info(eth_netif, ESP_NETIF_DNS_FALLBACK...
esp_err_t esp_netif_deinit(void); /** * @brief Creates an instance of new esp-netif object based on provided config * * @param[in] esp_netif_config pointer esp-netif configuration * * @return * - pointer to esp-netif object on success * - NULL otherwise */ esp_netif_t *esp_n...