@@ -71,7 +71,7 @@ unsigned long GSMConnectionHandler::getTime() {
7171 return gsmAccess.getTime ();
7272}
7373
74- void GSMConnectionHandler::check () {
74+ NetworkConnectionState GSMConnectionHandler::check () {
7575 unsigned long const now = millis ();
7676 int gsmAccessAlive;
7777 if (now - lastConnectionTickTime > connectionTickTimeInterval) {
@@ -89,7 +89,7 @@ void GSMConnectionHandler::check() {
8989 if (networkStatus == GSM3_NetworkStatus_t::ERROR) {
9090 // NO FURTHER ACTION WILL FOLLOW THIS
9191 changeConnectionState (NetworkConnectionState::ERROR);
92- return ;
92+ return netConnectionState ;
9393 }
9494 Debug.print (DBG_INFO, " Sending PING to outer space..." );
9595 int pingResult;
@@ -98,11 +98,11 @@ void GSMConnectionHandler::check() {
9898 if (pingResult < 0 ) {
9999 Debug.print (DBG_ERROR, " PING failed" );
100100 Debug.print (DBG_INFO, " Retrying in \" %d\" milliseconds" , connectionTickTimeInterval);
101- return ;
101+ return netConnectionState ;
102102 } else {
103103 Debug.print (DBG_INFO, " Connected to GPRS Network" );
104104 changeConnectionState (NetworkConnectionState::CONNECTED);
105- return ;
105+ return netConnectionState ;
106106 }
107107 }
108108 break ;
@@ -111,7 +111,7 @@ void GSMConnectionHandler::check() {
111111 Debug.print (DBG_VERBOSE, " GPRS.isAccessAlive(): %d" , gsmAccessAlive);
112112 if (gsmAccessAlive != 1 ) {
113113 changeConnectionState (NetworkConnectionState::DISCONNECTED);
114- return ;
114+ return netConnectionState ;
115115 }
116116 Debug.print (DBG_VERBOSE, " Connected to Cellular Network" );
117117 }
@@ -130,6 +130,8 @@ void GSMConnectionHandler::check() {
130130 }
131131 lastConnectionTickTime = now;
132132 }
133+
134+ return netConnectionState;
133135}
134136
135137/* *****************************************************************************
0 commit comments