From 129a2650c22915bc789b6bdbc9d360bd97059e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gassmann?= Date: Sat, 28 Sep 2024 18:05:02 +0200 Subject: [+] WiFi with dpp on first setup + SNTP --- components/wifi/dpp_wifi.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 components/wifi/dpp_wifi.h (limited to 'components/wifi/dpp_wifi.h') diff --git a/components/wifi/dpp_wifi.h b/components/wifi/dpp_wifi.h new file mode 100644 index 0000000..e8a2519 --- /dev/null +++ b/components/wifi/dpp_wifi.h @@ -0,0 +1,47 @@ +#ifndef DPP_H +#define DPP_H + +#include +#include "esp_system.h" +#include "esp_wifi.h" +#include "esp_event.h" +#include "esp_dpp.h" +#include "esp_log.h" +#include "nvs_flash.h" +#include "qrcode.h" + +#ifdef CONFIG_ESP_DPP_LISTEN_CHANNEL_LIST +#define EXAMPLE_DPP_LISTEN_CHANNEL_LIST CONFIG_ESP_DPP_LISTEN_CHANNEL_LIST +#else +#define EXAMPLE_DPP_LISTEN_CHANNEL_LIST "6" +#endif + +#ifdef CONFIG_ESP_DPP_BOOTSTRAPPING_KEY +#define EXAMPLE_DPP_BOOTSTRAPPING_KEY CONFIG_ESP_DPP_BOOTSTRAPPING_KEY +#else +#define EXAMPLE_DPP_BOOTSTRAPPING_KEY 0 +#endif + +#ifdef CONFIG_ESP_DPP_DEVICE_INFO +#define EXAMPLE_DPP_DEVICE_INFO CONFIG_ESP_DPP_DEVICE_INFO +#else +#define EXAMPLE_DPP_DEVICE_INFO 0 +#endif + +#define CURVE_SEC256R1_PKEY_HEX_DIGITS 64 + +static const char *WIFI_TAG = "wifi dpp-enrollee"; + +static wifi_config_t s_dpp_wifi_configuration; +static int s_retry_num = 0; + +/* FreeRTOS event group to signal when we are connected*/ +static EventGroupHandle_t s_dpp_event_group; + +#define DPP_CONNECTED_BIT BIT0 +#define DPP_CONNECT_FAIL_BIT BIT1 +#define DPP_AUTH_FAIL_BIT BIT2 +#define WIFI_MAX_RETRY_NUM 3 + +void launch_dpp(void); +#endif \ No newline at end of file -- cgit v1.2.3