19#ifndef CONNECTIONMANAGER_H
20#define CONNECTIONMANAGER_H
49 bool receivedUserSelection();
57 const char *getConnectionName();
61 bool connectionError();
65 const char *getConnectionErrorMessage();
69 uint8_t getRetryCounter();
78 void setCommandStationList(CommandStationDetails *commandStationList, uint8_t commandStationCount);
82 void selectCommandStation(uint8_t commandStationIndex);
89 bool _receivedUserSelection;
90 uint8_t _selectedCommandStation;
91 uint8_t _commandStationCount;
92 CommandStationDetails *_commandStationList;
94 unsigned long _wifiRetryDelay;
95 unsigned long _lastWifiRetry;
96 uint8_t _wifiMaxRetries;
98 unsigned long _serverRetryDelay;
99 unsigned long _lastServerRetry;
100 uint8_t _serverMaxRetries;
101 uint8_t _serverRetry;
103 const char *_connectionName;
104 bool _connectionError;
105 const char *_connectionErrorMessage;
106 uint8_t _retryCounter;
109 WiFiClient _wifiClient;
112 bool _connectWiFi(
unsigned long currentMillis);
115 bool _connectServer(
unsigned long currentMillis);
Class to manage all WiFi and serial connections used to connect to a CommandStation.
Definition ConnectionManager.h:30
bool connected()
Check if connections are active.
Definition ConnectionManager.cpp:66
void update()
Ensure all connections are alive and retries are managed.
Definition ConnectionManager.cpp:48
ConnectionManager()
Constructor for the ConnectionManager.
Definition ConnectionManager.cpp:21
bool _connected
Definition ConnectionManager.h:87
Stream * getConnectionStream()
Get the connection stream managed by this ConnectionManager.
Definition ConnectionManager.cpp:68