You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we need to make sure that we setup the operator selection to be in 'numeric' format.
42
-
// i.e. it is made up of a network and country code when returned by the modem e.g. Operator = 23415. This allows easy logic parsing for
43
-
// setting up other network parameters in future.
44
-
DBG("LinkMonitor::init() being called. This should only happen once: executinging AT+COPS=0,2");
45
-
int ret = m_pIf->executeSimple("AT+COPS=0,2", NULL, DEFAULT_TIMEOUT); //Configure to set the operator string to Country Code and mobile network code
46
-
if(ret != OK)
41
+
m_gsm = gsm;
42
+
if (m_gsm)
47
43
{
48
-
WARN(" NET_PROTOCOL error from sending the AT+COPS command to the modem. ");
49
-
return NET_PROTOCOL;
44
+
// we need to make sure that we setup the operator selection to be in 'numeric' format.
45
+
// i.e. it is made up of a network and country code when returned by the modem e.g. Operator = 23415. This allows easy logic parsing for
46
+
// setting up other network parameters in future.
47
+
DBG("LinkMonitor::init() being called. This should only happen once: executinging AT+COPS=0,2");
48
+
int ret = m_pIf->executeSimple("AT+COPS=0,2", NULL, DEFAULT_TIMEOUT); //Configure to set the operator string to Country Code and mobile network code
49
+
if(ret != OK)
50
+
{
51
+
WARN(" NET_PROTOCOL error from sending the AT+COPS command to the modem. ");
52
+
return NET_PROTOCOL;
53
+
}
50
54
}
51
55
return OK;
52
56
}
@@ -136,7 +140,7 @@ int LinkMonitor::getState(int* pRssi, REGISTRATION_STATE* pRegistrationState, BE
136
140
m_rssi = 0;
137
141
m_registrationState = REGISTRATION_STATE_UNKNOWN;
138
142
m_bearer = BEARER_UNKNOWN;
139
-
int ret = m_pIf->execute("AT+CREG?;+COPS?;+CSQ", this, NULL, DEFAULT_TIMEOUT); //Configure to get registration info & get it; get signal quality
143
+
int ret = m_pIf->execute(m_gsm ? "AT+CREG?;+COPS?;+CSQ" : "AT+CREG?;+CSQ", this, NULL, DEFAULT_TIMEOUT); //Configure to get registration info & get it; get signal quality
0 commit comments