MQTT Communication
Smart Factory
Network.h
Go to the documentation of this file.
1 
16 #ifndef NETWORK_H__
17 #define NETWORK_H__
18 
19 #include "Arduino.h"
20 
21 #include "LogConfiguration.h"
22 
23 #include <SPI.h>
24 #include <WiFi101.h>
25 
30 class Network {
31  //=====PUBLIC====================================================================================
32  public:
43  Network(String ssid, String password, int WIFI_CS, int WIFI_IRQ, int WIFI_RST, int WIFI_EN);
44 
54  void init();
55 
63  void connectToWiFi();
64 
73  void printNetworkInfo();
74 
75  //=====PRIVATE====================================================================================
76  private:
83  void printWiFiData();
84 
90  void printCurrentNet();
91 
97  void printMacAddress(byte mac[]);
98 
105  String decodeWiFistate(int errorcode);
106 
121  String decodeEncryptionType(int errorcode);
122 
123  String pSsid;
124  String pPassword;
125  int pWifi_CS;
128  int pWifi_EN;
129  IPAddress pIPLocal;
130  byte pMacRouter[6];
131  byte pMac[6];
132  byte pEncryption;
133 
146  long pRssi;
147 };
148 #endif
void printMacAddress(byte mac[])
Pritns Mac-address.
Definition: Network.cpp:105
void connectToWiFi()
Connects to a WiFi with the given Credential.
Definition: Network.cpp:40
void printNetworkInfo()
Prints all relevant Network-Information of the connected network to serial.
Definition: Network.cpp:64
byte pEncryption
value represents the type of encryption
Definition: Network.h:132
byte pMacRouter[6]
Contains MAC Adress of the Router BSSID.
Definition: Network.h:130
Network(String ssid, String password, int WIFI_CS, int WIFI_IRQ, int WIFI_RST, int WIFI_EN)
Construct a new Network object.
Definition: Network.cpp:17
IPAddress pIPLocal
Contains own IP-Adress.
Definition: Network.h:129
long pRssi
The current RSSI /Received Signal Strength in dBm.
Definition: Network.h:146
int pWifi_CS
Definition: Network.h:125
String decodeWiFistate(int errorcode)
Decodes the Error Values from Wifi status() and returns a description.
Definition: Network.cpp:118
int pWiFi_IRQ
Definition: Network.h:126
void printCurrentNet()
Prints all relevant Information of the current Network.
Definition: Network.cpp:85
void init()
Intitialize WLan-Hardware.
Definition: Network.cpp:25
void printWiFiData()
Prints all relevant WiFi-Information of the connected network to serial.
Definition: Network.cpp:72
int pWifi_RST
Definition: Network.h:127
String decodeEncryptionType(int errorcode)
Construct a new decode Encryption Type object.
Definition: Network.cpp:152
String pPassword
Contains WiFi Password.
Definition: Network.h:124
String pSsid
Contains the SSID the WiFi shield is currently connected to.
Definition: Network.h:123
byte pMac[6]
Contains own MAC Adress.
Definition: Network.h:131
int pWifi_EN
Definition: Network.h:128
Handels the WLAN-Connection.
Definition: Network.h:30