@@ -58,26 +58,25 @@ unsigned long GSMConnectionHandler::getTime()
58
58
59
59
NetworkConnectionState GSMConnectionHandler::update_handleInit ()
60
60
{
61
- if (_gsm.begin (_pin) = = GSM_READY)
61
+ if (_gsm.begin (_pin) ! = GSM_READY)
62
62
{
63
- Debug.print (DBG_INFO, " SIM card ok" );
64
- _gsm.setTimeout (GSM_TIMEOUT);
65
-
66
- GSM3_NetworkStatus_t const network_status = _gprs.attachGPRS (_apn, _login, _pass, true );
67
- Debug.print (DBG_DEBUG, " GPRS.attachGPRS(): %d" , network_status);
68
- if (network_status == GSM3_NetworkStatus_t::ERROR)
69
- {
70
- Debug.print (DBG_ERROR, " GPRS attach failed" );
71
- Debug.print (DBG_ERROR, " Make sure the antenna is connected and reset your board." );
72
- return NetworkConnectionState::ERROR;
73
- }
74
- return NetworkConnectionState::CONNECTING;
63
+ Debug.print (DBG_ERROR, " SIM not present or wrong PIN" );
64
+ return NetworkConnectionState::ERROR;
75
65
}
76
- else
66
+
67
+ Debug.print (DBG_INFO, " SIM card ok" );
68
+ _gsm.setTimeout (GSM_TIMEOUT);
69
+
70
+ GSM3_NetworkStatus_t const network_status = _gprs.attachGPRS (_apn, _login, _pass, true );
71
+ Debug.print (DBG_DEBUG, " GPRS.attachGPRS(): %d" , network_status);
72
+ if (network_status == GSM3_NetworkStatus_t::ERROR)
77
73
{
78
- Debug.print (DBG_ERROR, " SIM not present or wrong PIN" );
74
+ Debug.print (DBG_ERROR, " GPRS attach failed" );
75
+ Debug.print (DBG_ERROR, " Make sure the antenna is connected and reset your board." );
79
76
return NetworkConnectionState::ERROR;
80
77
}
78
+
79
+ return NetworkConnectionState::CONNECTING;
81
80
}
82
81
83
82
NetworkConnectionState GSMConnectionHandler::update_handleConnecting ()
0 commit comments