mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-05-05 17:20:23 +02:00
36 lines
893 B
C
36 lines
893 B
C
#pragma once
|
|
|
|
#include "lwip/sys.h"
|
|
#include <arpa/inet.h>
|
|
#include <lwip/netdb.h>
|
|
|
|
#include "freertos/event_groups.h"
|
|
|
|
#define WIFI_SSID CONFIG_ESP_WIFI_SSID
|
|
#define WIFI_PASS CONFIG_ESP_WIFI_PASSWORD
|
|
|
|
#define WIFI_MAXIMUM_RETRY CONFIG_ESP_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
|
|
|
|
// enum of wifi statuses
|
|
typedef enum
|
|
{
|
|
WIFI_CONNECTED,
|
|
WIFI_DISCONNECTED,
|
|
WIFI_CONNECTING,
|
|
WIFI_DISCONNECTING,
|
|
WIFI_CONNECT_FAILED,
|
|
WIFI_RETRYING,
|
|
} wifi_status_t;
|
|
|
|
void toggle_wifi_softap(void);
|
|
void wifi_softap_off(void);
|
|
void wifi_init(const char * wifi_ssid, const char * wifi_pass);
|
|
EventBits_t wifi_connect(void);
|
|
void generate_ssid(char * ssid);
|