main/task_wifi.h

Sat, 14 Mar 2020 13:07:02 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 14 Mar 2020 13:07:02 +0100
changeset 47
1ab1f4a8c328
parent 44
e52d11b8f252
child 49
f526ba98a6b7
permissions
-rw-r--r--

Version 0.2.2 Changed to use a permanent network and WiFi connection. Removed three mainloop stages. Removed MQTT sequence counter that was not used. Update WiFi rssi status during eacht measure cycle. Changed FreeRTOS schedulng to 500 Hz.

/**
 * @file task_wifi.h
 * @brief WiFi task. Connect to the known AP with the strongest signal.
 */

#ifndef _TASK_WIFI_H
#define _TASK_WIFI_H


/**
 * @brief Defines the maximum number of access points that can be scanned.
 */
#define MAX_AP_NUM 			5


/**
 * @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 Test if Wifi is ready and connected
 * @return Return true is connected and we have an IP address.
 */
bool ready_WiFi(void);


void status_WiFi(void);


/**
 * @brief Main task for the wifi_manager
 * @param pvParameters Parameters for the task.
 */
void task_wifi(void *pvParameters);


#endif

mercurial