split into more components
Signed-off-by: Peter Siegmund <peter@rdkr.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
uint8_t init_wifi(void);
|
||||
esp_err_t init_wifi(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user