split into more components

Signed-off-by: Peter Siegmund <peter@rdkr.com>
This commit is contained in:
Peter Siegmund
2024-06-07 23:00:21 +02:00
parent 3cb1b31a37
commit 53d4bf2c5b
7 changed files with 78 additions and 68 deletions

View File

@@ -50,7 +50,7 @@ static void event_handler(void* arg,
}
}
uint8_t init_wifi(void) {
esp_err_t init_wifi(void) {
s_wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_netif_init());
@@ -92,12 +92,12 @@ uint8_t init_wifi(void) {
* can test which event actually happened. */
if (bits & WIFI_CONNECTED_BIT) {
ESP_LOGI(TAG, "connected to ap SSID:%s", WIFI_SSID);
return 0;
return ESP_OK;
} else if (bits & WIFI_FAIL_BIT) {
ESP_LOGI(TAG, "Failed to connect to SSID:%s", WIFI_SSID);
return 1;
return ESP_ERR_TIMEOUT;
} else {
ESP_LOGE(TAG, "UNEXPECTED EVENT");
return -1;
return ESP_FAIL;
}
}