@@ -69,17 +69,6 @@ NBConnectionHandler::NBConnectionHandler(char const * pin, char const * apn, cha
6969 PUBLIC MEMBER FUNCTIONS
7070 ******************************************************************************/
7171
72- void NBConnectionHandler::init () {
73- char msgBuffer[120 ];
74- if (_nb.begin (_pin, _apn, _login, _pass) == NB_READY) {
75- Debug.print (DBG_INFO, " SIM card ok" );
76- _nb.setTimeout (CHECK_INTERVAL_RETRYING);
77- changeConnectionState (NetworkConnectionState::CONNECTING);
78- } else {
79- Debug.print (DBG_ERROR, " SIM not present or wrong PIN" );
80- }
81- }
82-
8372unsigned long NBConnectionHandler::getTime () {
8473 return _nb.getTime ();
8574}
@@ -90,9 +79,15 @@ NetworkConnectionState NBConnectionHandler::check() {
9079 if (now - lastConnectionTickTime > connectionTickTimeInterval) {
9180 switch (_netConnectionState) {
9281 case NetworkConnectionState::INIT: {
93- init ();
82+ if (_nb.begin (_pin, _apn, _login, _pass) == NB_READY) {
83+ Debug.print (DBG_INFO, " SIM card ok" );
84+ _nb.setTimeout (CHECK_INTERVAL_RETRYING);
85+ changeConnectionState (NetworkConnectionState::CONNECTING);
86+ } else {
87+ Debug.print (DBG_ERROR, " SIM not present or wrong PIN" );
9488 }
95- break ;
89+ }
90+ break ;
9691
9792 case NetworkConnectionState::CONNECTING: {
9893 // NOTE: Blocking Call when 4th parameter == true
0 commit comments