Sentinel
Loading...
Searching...
No Matches
network.h
Go to the documentation of this file.
1
6
7#ifndef NETWORK_H
8#define NETWORK_H
9
10#include "utilities.h"
11#include <Arduino.h>
12#include <TinyGsmClient.h>
13
21
22class Network
23{
24public:
25 Network();
26 void begin();
27 bool enableModem() const;
28 bool disableModem() const;
29 bool connectWiFi(const char *ssid, const char *password);
30 bool connectLTE(const char *apn);
31 bool isWiFiConnected() const;
32 bool isLTEConnected();
33 bool isConnected();
34 void disconnectWiFi();
35 void disconnectLTE();
36 void maintainConnection(const char *ssid, const char *password, const char *apn);
37
38private:
39 bool wifiConnected;
40 bool lteConnected;
41};
42
43#endif
bool isLTEConnected()
Checks if the device is connected to LTE network.
Definition network.cpp:204
bool enableModem() const
Enables the LTE modem.
Definition network.cpp:92
void begin()
Initializes the network hardware.
Definition network.cpp:28
void maintainConnection(const char *ssid, const char *password, const char *apn)
Maintains the network connection by checking WiFi and LTE status.
Definition network.cpp:239
void disconnectWiFi()
Disconnects from the WiFi network.
Definition network.cpp:69
bool isWiFiConnected() const
Checks if the device is connected to WiFi.
Definition network.cpp:80
bool connectWiFi(const char *ssid, const char *password)
Connects to WiFi network.
Definition network.cpp:46
bool connectLTE(const char *apn)
Connects to LTE network using the specified APN.
Definition network.cpp:160
void disconnectLTE()
Disconnects from the LTE network.
Definition network.cpp:183
bool isConnected()
Checks if the device is connected to either WiFi or LTE network.
Definition network.cpp:226