Skip to content

Commit c38bc16

Browse files
committed
catM1: use hardware reset if modem cannot attach to network
1 parent 7c50a80 commit c38bc16

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/CatM1ConnectionHandler.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ CatM1ConnectionHandler::CatM1ConnectionHandler(
4545
strncpy(_settings.catm1.pass, pass, sizeof(_settings.catm1.pass)-1);
4646
_settings.catm1.rat = static_cast<uint8_t>(rat);
4747
_settings.catm1.band = band;
48+
_reset = false;
4849
}
4950

5051
/******************************************************************************
@@ -77,11 +78,14 @@ NetworkConnectionState CatM1ConnectionHandler::update_handleInit()
7778
_settings.catm1.login,
7879
_settings.catm1.pass,
7980
static_cast<RadioAccessTechnologyType>(_settings.catm1.rat) ,
80-
_settings.catm1.band))
81+
_settings.catm1.band,
82+
_reset))
8183
{
8284
Debug.print(DBG_ERROR, F("The board was not able to register to the network..."));
85+
_reset = true;
8386
return NetworkConnectionState::DISCONNECTED;
8487
}
88+
_reset = false;
8589
return NetworkConnectionState::CONNECTING;
8690
}
8791

src/CatM1ConnectionHandler.h

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class CatM1ConnectionHandler : public ConnectionHandler
6060

6161
private:
6262

63+
bool _reset;
64+
6365
GSMUDP _gsm_udp;
6466
GSMClient _gsm_client;
6567
};

0 commit comments

Comments
 (0)