239 tcpip_adapter_ip_info_t ip; |
239 tcpip_adapter_ip_info_t ip; |
240 memset(&ip, 0, sizeof(tcpip_adapter_ip_info_t)); |
240 memset(&ip, 0, sizeof(tcpip_adapter_ip_info_t)); |
241 if (tcpip_adapter_get_ip_info(ESP_IF_WIFI_STA, &ip) == 0) { |
241 if (tcpip_adapter_get_ip_info(ESP_IF_WIFI_STA, &ip) == 0) { |
242 if (xSemaphoreTake(xSemaphoreWiFi, 10) == pdTRUE) { |
242 if (xSemaphoreTake(xSemaphoreWiFi, 10) == pdTRUE) { |
243 wifi_state->STA_online = true; |
243 wifi_state->STA_online = true; |
244 snprintf(wifi_state->STA_ip, 15, IPSTR, IP2STR(&ip.ip)); |
244 snprintf(wifi_state->STA_ip, 16, IPSTR, IP2STR(&ip.ip)); |
245 snprintf(wifi_state->STA_nm, 15, IPSTR, IP2STR(&ip.netmask)); |
245 snprintf(wifi_state->STA_nm, 16, IPSTR, IP2STR(&ip.netmask)); |
246 snprintf(wifi_state->STA_gw, 15, IPSTR, IP2STR(&ip.gw)); |
246 snprintf(wifi_state->STA_gw, 16, IPSTR, IP2STR(&ip.gw)); |
247 xSemaphoreGive(xSemaphoreWiFi); |
247 xSemaphoreGive(xSemaphoreWiFi); |
248 } |
248 } |
249 } |
249 } |
250 /* |
250 /* |
251 * There doesn't seem to be support for configuring NTP via DHCP so |
251 * There doesn't seem to be support for configuring NTP via DHCP so |
604 |
604 |
605 |
605 |
606 |
606 |
607 bool WiFi_Init(void) |
607 bool WiFi_Init(void) |
608 { |
608 { |
609 char pwd[65], pmpt[32]; |
609 char pwd[65], pmpt[96]; |
610 |
610 |
611 switch (Main_Screen) { |
611 switch (Main_Screen) { |
612 case MAIN_TOOLS_SETUP_WIFI: |
612 case MAIN_TOOLS_SETUP_WIFI: |
613 TopMessage((char *)"WiFi"); |
613 TopMessage((char *)"WiFi"); |
614 TFT_setFont(DEJAVU24_FONT, NULL); |
614 TFT_setFont(DEJAVU24_FONT, NULL); |
686 Buttons[0].dark = true; |
686 Buttons[0].dark = true; |
687 break; |
687 break; |
688 |
688 |
689 case MAIN_TOOLS_SETUP_WIFI_NEW: |
689 case MAIN_TOOLS_SETUP_WIFI_NEW: |
690 TopMessage((char *)"WiFi nieuw"); |
690 TopMessage((char *)"WiFi nieuw"); |
691 snprintf(pmpt, 32, "Password for %s", _wifi_ssid); |
691 snprintf(pmpt, 95, "Password for %s", _wifi_ssid); |
692 pwd[0] = '\0'; |
692 pwd[0] = '\0'; |
693 EditTextMin(pmpt, pwd, 64, 8); |
693 EditTextMin(pmpt, pwd, 64, 8); |
694 /* |
694 /* |
695 * Disconnect first |
695 * Disconnect first |
696 */ |
696 */ |