main/task_wifi.h

Sun, 18 Jul 2021 11:25:55 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 18 Jul 2021 11:25:55 +0200
changeset 109
72af8958b469
parent 94
87aa80b8e452
permissions
-rw-r--r--

Version 0.3.17. Made the Hendi PWM change official.

/**
 * @file task_wifi.h
 * @brief WiFi task. Connects to a known Access Point. If we know more then
 *        one AP, try to connect all of them until it succeeds (Not yet written).
 */

#ifndef _TASK_WIFI_H
#define _TASK_WIFI_H


/**
 * @brief Defines the maximum number of access points that can be scanned.
 *
 * To save memory and avoid nasty out of memory errors,
 * we can limit the number of APs detected in a wifi scan.
 * The display can handle 7 entries, allow a few more.
 */
#define MAX_AP_NUM 			10


/**
 * @brief Structure containing the information of the driver task.
 */
typedef struct {
    bool		STA_connected;		///< Connected to AP as station.
    bool		STA_online;		///< Connected and online.
    char		STA_ssid[33];		///< Connected to this SSID.
    int8_t		STA_rssi;		///< Signal strength.
    char		STA_ip[17];		///< IP address.
    char		STA_nm[17];		///< IP netmask.
    char		STA_gw[17];		///< IP gateway.
} WIFI_State;

/**
 * @brief Update reason codes.
 */
typedef enum update_reason_code_t {
    UPDATE_CONNECTION_OK = 0,
    UPDATE_FAILED_ATTEMPT = 1,
    UPDATE_USER_DISCONNECT = 2,
    UPDATE_LOST_CONNECTION = 3
} update_reason_code_t;



/**
 * @brief Main task for the wifi_manager
 */
void task_wifi(void *);

/**
 * @brief WiFi setup, init screens.
 */
bool WiFi_Init(void);

/**
 * @brief WiFi setup, loop screens.
 */
bool WiFi_Loop(void);


#endif

mercurial