Finish documention until someone change something
This commit is contained in:
+40
-4
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file network.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief TODO: write some stuff here too
|
||||
* @brief Contains the Network class.
|
||||
* @version 0.1
|
||||
* @date 2021-12-14
|
||||
*
|
||||
@@ -18,17 +18,53 @@
|
||||
|
||||
#include "networkConfig.h"
|
||||
|
||||
#define MQTT_TIME_RECONNECT 2500
|
||||
|
||||
/**
|
||||
* @brief This class handles all network stuff
|
||||
*
|
||||
* This class only inherits static functions and members and use
|
||||
* only the configuration data is given by networkConfig.h
|
||||
*
|
||||
*/
|
||||
class Network {
|
||||
public:
|
||||
/**
|
||||
* @brief Set the all IPs needed by this class
|
||||
*/
|
||||
static void setIps();
|
||||
|
||||
/**
|
||||
* @brief Establish a connection to the WiFi.
|
||||
*/
|
||||
static void connectWifi();
|
||||
|
||||
/**
|
||||
* @brief Set all general settings to connect to a broker.
|
||||
*/
|
||||
static void setupMQTT();
|
||||
|
||||
/**
|
||||
* @brief Checks if mqtt is still connected
|
||||
*
|
||||
* If mqtt is not connect, this function try a reconnect
|
||||
* with the function connectMQTT. This function should be
|
||||
* called every mainloop.
|
||||
*/
|
||||
static void checkMQTT();
|
||||
static PubSubClient* getMqtttClient();
|
||||
|
||||
/**
|
||||
* @brief Get the Mqtt Client object
|
||||
*
|
||||
* @return PubSubClient*
|
||||
*/
|
||||
static PubSubClient* getMqttClient();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Tries a connect to the broker
|
||||
*
|
||||
* @return true if the connect attemp was successful
|
||||
* @return false if the connect attemp was unsuccessful
|
||||
*/
|
||||
static bool connectMQTT();
|
||||
|
||||
static IPAddress local_IP;
|
||||
|
||||
Reference in New Issue
Block a user