Skip to content

Commit 8646505

Browse files
committed
- more cleanup and minor refactoring
1 parent e905238 commit 8646505

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/GSMConnectionManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ void GSMConnectionManager::changeConnectionState(NetworkConnectionState _newStat
124124
void GSMConnectionManager::check() {
125125
char msgBuffer[120];
126126
unsigned long const now = millis();
127-
GSM3_NetworkStatus_t networkStatus = GSM3_NetworkStatus_t::IDLE;
128127
int gsmAccessAlive;
129128
if (now - lastConnectionTickTime > connectionTickTimeInterval) {
130129
switch (netConnectionState) {
@@ -133,6 +132,7 @@ void GSMConnectionManager::check() {
133132
break;
134133
case CONNECTION_STATE_CONNECTING:
135134
/*** Blocking Call when 4th parameter == true ***/
135+
GSM3_NetworkStatus_t networkStatus;
136136
networkStatus = gprs.attachGPRS(apn, login, pass, true);
137137
sprintf(msgBuffer, "GPRS.attachGPRS(): %d", networkStatus);
138138
debugMessage(msgBuffer, 3);

src/WiFiConnectionManager.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void WiFiConnectionManager::changeConnectionState(NetworkConnectionState _newSta
106106

107107
void WiFiConnectionManager::check() {
108108
char msgBuffer[120];
109-
unsigned long now = millis();
109+
unsigned long const now = millis();
110110
int networkStatus = 0;
111111
if (now - lastConnectionTickTime > connectionTickTimeInterval) {
112112
switch (netConnectionState) {
@@ -122,11 +122,11 @@ void WiFiConnectionManager::check() {
122122
}
123123
sprintf(msgBuffer, "Current WiFi Firmware: %s", WiFi.firmwareVersion());
124124
debugMessage(msgBuffer, 0);
125-
if(strcmp(WiFi.firmwareVersion(), WIFI_FIRMWARE_VERSION_REQUIRED) != 0){
126-
125+
if(WiFi.firmwareVersion() < WIFI_FIRMWARE_VERSION_REQUIRED){
127126
sprintf(msgBuffer, "Latest WiFi Firmware: %s", WIFI_FIRMWARE_VERSION_REQUIRED);
128127
debugMessage(msgBuffer, 0);
129128
debugMessage("Please update to latest version for optimal performance.", 0);
129+
delay(5000);
130130
}
131131
changeConnectionState(CONNECTION_STATE_CONNECTING);
132132
break;
@@ -150,7 +150,7 @@ void WiFiConnectionManager::check() {
150150
break;
151151
case CONNECTION_STATE_GETTIME:
152152
unsigned long networkTime;
153-
networkTime = WiFi.getTime();
153+
networkTime = getTime();
154154
debugMessage(".", 3, false, false);
155155
if(networkTime > lastValidTimestamp){
156156
lastValidTimestamp = networkTime;

0 commit comments

Comments
 (0)