Add in changes to wolfssl_server

This commit is contained in:
Andras Fekete
2022-12-16 11:55:53 -05:00
parent 814ad9fc38
commit d0f0d66b80

View File

@ -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