2021-08-19 21:57:16 +02:00
|
|
|
#ifndef _WIFI_INTERFACE_H_
|
|
|
|
|
#define _WIFI_INTERFACE_H_
|
|
|
|
|
|
2021-10-16 22:07:22 +02:00
|
|
|
#include "esp_netif_types.h"
|
2024-01-23 20:34:05 +01:00
|
|
|
#include "freertos/FreeRTOS.h"
|
2021-08-19 21:57:16 +02:00
|
|
|
#include "freertos/event_groups.h"
|
2024-01-23 20:34:05 +01:00
|
|
|
#include "freertos/task.h"
|
2021-08-19 21:57:16 +02:00
|
|
|
|
|
|
|
|
// use wifi provisioning
|
|
|
|
|
#define ENABLE_WIFI_PROVISIONING CONFIG_ENABLE_WIFI_PROVISIONING
|
|
|
|
|
|
|
|
|
|
/* Hardcoded WiFi configuration that you can set via
|
|
|
|
|
'make menuconfig'.
|
|
|
|
|
*/
|
|
|
|
|
#if !ENABLE_WIFI_PROVISIONING
|
|
|
|
|
#define WIFI_SSID CONFIG_WIFI_SSID
|
|
|
|
|
#define WIFI_PASSWORD CONFIG_WIFI_PASSWORD
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define WIFI_MAXIMUM_RETRY CONFIG_WIFI_MAXIMUM_RETRY
|
|
|
|
|
|
|
|
|
|
/* The event group allows multiple bits for each event, but we only care about
|
|
|
|
|
* two events:
|
|
|
|
|
* - we are connected to the AP with an IP
|
|
|
|
|
* - we failed to connect after the maximum amount of retries */
|
|
|
|
|
#define WIFI_CONNECTED_BIT BIT0
|
|
|
|
|
#define WIFI_FAIL_BIT BIT1
|
|
|
|
|
|
2025-01-22 23:37:00 +01:00
|
|
|
void wifi_start(void);
|
2024-01-23 20:34:05 +01:00
|
|
|
esp_netif_t *get_current_netif(void);
|
2021-08-19 21:57:16 +02:00
|
|
|
|
|
|
|
|
#endif /* _WIFI_INTERFACE_H_ */
|