diff options
| Commit | 56828e01f75fbfafc44c6969201129aeb1d71308 (patch) | |
|---|---|---|
| Author | 2024-05-26 11:40:12 +0300 | |
| Committer | 2024-05-26 11:40:12 +0300 | |
| Files | 41c1d82dad1048000352e331cd59544192d0b146 | |
| uni-projects-56828e01f75fbfafc44c6969201129aeb1d71308.tar uni-projects-56828e01f75fbfafc44c6969201129aeb1d71308.tar.gz uni-projects-56828e01f75fbfafc44c6969201129aeb1d71308.zip | ||
| Parent | 500043fe9a6c32202c0bde14cac02de85b820c21 (diff) | |
[iot/goam] Moved WiFi icon on top row
1 files changed, 6 insertions, 4 deletions
| -rw-r--r-- | Year 3/Internet of things/goam/main/wifi.c | 10 |
diff --git a/Year 3/Internet of things/goam/main/wifi.c b/Year 3/Internet of things/goam/main/wifi.c index 32b82ee..0322518 100644 --- a/Year 3/Internet of things/goam/main/wifi.c +++ b/Year 3/Internet of things/goam/main/wifi.c @@ -11,6 +11,7 @@ #include "display.h" #define IP_LINE 2 +#define AT_WIFI_ICON 1, 4 #define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_PSK @@ -57,7 +58,8 @@ static unsigned short MAX_AP = 16; static TaskHandle_t launcher_handle = NULL; static void scan_and_connect_task() { - display_printon(CHAR_NOWIFI "---.---.---.---" "-" LINE_CLEAR LINE_CLEAR, IP_LINE); + display_printat(CHAR_NO_WIFI, AT_WIFI_ICON); + display_printon("---.---.---.--- " "-" LINE_CLEAR LINE_CLEAR, IP_LINE); ESP_ERROR_CHECK(esp_wifi_scan_start(NULL, true)); wifi_ap_record_t ap_info[MAX_AP]; @@ -123,13 +125,13 @@ static void launcher_scan_and_connect_task(void*) { static int connect_tries = 0; static void sta_connected_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { - display_printon(CHAR_WIFI, IP_LINE); + display_printat(CHAR_WIFI, AT_WIFI_ICON); } static void sta_disconnect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { if (connect_tries < ESP_MAXIMUM_RETRY) { esp_wifi_connect(); - display_printon(CHAR_WIFI_EXCLAM, IP_LINE); + display_printat(CHAR_WIFI_EXCLAM, AT_WIFI_ICON); connect_tries++; ESP_LOGW(TAG, "Retrying to connect... Try %d/%d", connect_tries, ESP_MAXIMUM_RETRY); vTaskDelay(200 / portTICK_PERIOD_MS); @@ -147,7 +149,7 @@ static void ip_got_handler(void* arg, esp_event_base_t event_base, int32_t event ESP_LOGI(TAG, "Connected to SSID:%s password:%s, got ip:" IPSTR, ESP_WIFI_SSID, ESP_WIFI_PASS, IP2STR(&event->ip_info.ip)); char ip[17]; - sprintf(ip, CHAR_WIFI IPSTR, IP2STR(&event->ip_info.ip)); + sprintf(ip, IPSTR, IP2STR(&event->ip_info.ip)); display_printon(ip, IP_LINE); display_printon(ESP_WIFI_SSID, 3); } |
