From d0f0d66b803f19ab40ef772dc7f88b858c78a77f Mon Sep 17 00:00:00 2001 From: Andras Fekete Date: Fri, 16 Dec 2022 11:55:53 -0500 Subject: [PATCH] Add in changes to wolfssl_server --- .../examples/wolfssl_server/main/wifi_connect.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/wifi_connect.c b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/wifi_connect.c index d2125000c..672c85fe2 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/wifi_connect.c +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/main/wifi_connect.c @@ -29,10 +29,11 @@ #include "nvs_flash.h" #if ESP_IDF_VERSION_MAJOR >= 4 #include "protocol_examples_common.h" -#endif - +#else const static int CONNECTED_BIT = BIT0; static EventGroupHandle_t wifi_event_group; +#endif + /* prefix for logging */ const static char *TAG = "tls_server"; /* proto-type definition */ @@ -77,7 +78,11 @@ static void set_time() static void tls_smp_server_init(void) { int ret; - xTaskHandle _handle; + #if ESP_IDF_VERSION_MAJOR >= 4 + TaskHandle_t _handle; + #else + xTaskHandle _handle; + #endif /* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */ ret = xTaskCreate(tls_smp_server_task, TLS_SMP_SERVER_TASK_NAME, @@ -90,6 +95,7 @@ static void tls_smp_server_init(void) ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME); } } +#if ESP_IDF_VERSION_MAJOR < 4 /* event handler for wifi events */ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) { @@ -118,6 +124,7 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event) } return ESP_OK; } +#endif /* entry point */ void app_main(void) { @@ -134,7 +141,6 @@ void app_main(void) #endif /* */ #if ESP_IDF_VERSION_MAJOR >= 4 - (void) wifi_event_handler; ESP_ERROR_CHECK(esp_event_loop_create_default()); /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. * Read "Establishing Wi-Fi or Ethernet Connection" section in