Skip to content

Commit 617b827

Browse files
committed
catM1: use hardware reset if modem cannot attach to network
1 parent 2d63bb1 commit 617b827

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/CatM1ConnectionHandler.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ CatM1ConnectionHandler::CatM1ConnectionHandler(const char * pin, const char * ap
3636
, _pass(pass)
3737
, _rat(rat)
3838
, _band(band)
39+
, _reset(false)
3940
{
4041

4142
}
@@ -64,11 +65,13 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleInit()
6465
digitalWrite(ON_MKR2, HIGH);
6566
#endif
6667

67-
if(!GSM.begin(_pin, _apn, _login, _pass, _rat, _band))
68+
if(!GSM.begin(_pin, _apn, _login, _pass, _rat, _band, _reset))
6869
{
6970
Debug.print(DBG_ERROR, F("The board was not able to register to the network..."));
71+
_reset = true;
7072
return NetworkConnectionState::DISCONNECTED;
7173
}
74+
_reset = false;
7275
return NetworkConnectionState::CONNECTING;
7376
}
7477

src/CatM1ConnectionHandler.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class CatM1ConnectionHandler : public ConnectionHandler
6666

6767
RadioAccessTechnologyType _rat;
6868
uint32_t _band;
69+
bool _reset;
6970

7071
GSMUDP _gsm_udp;
7172
GSMClient _gsm_client;

0 commit comments

Comments
 (0)