@@ -66,7 +66,6 @@ static int ec20_sim_card_check(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +86,10 @@ static int ec20_signal_quality_check(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
str = strstr(echo.buffer, "+CSQ:");
|
str = strstr(echo.buffer, "+CSQ:");
|
||||||
|
if (!str)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
sscanf(str, "+CSQ:%d,%d", &rssi, &ber);
|
sscanf(str, "+CSQ:%d,%d", &rssi, &ber);
|
||||||
if (rssi != 99) {
|
if (rssi != 99) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -111,6 +114,10 @@ static int ec20_gsm_network_check(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
str = strstr(echo.buffer, "+CREG:");
|
str = strstr(echo.buffer, "+CREG:");
|
||||||
|
if (!str)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
sscanf(str, "+CREG:%d,%d", &n, &stat);
|
sscanf(str, "+CREG:%d,%d", &n, &stat);
|
||||||
if (stat == 1) {
|
if (stat == 1) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -137,6 +144,10 @@ static int ec20_gprs_network_check(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
str = strstr(echo.buffer, "+CGREG:");
|
str = strstr(echo.buffer, "+CGREG:");
|
||||||
|
if (!str)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
sscanf(str, "+CGREG:%d,%d", &n, &stat);
|
sscanf(str, "+CGREG:%d,%d", &n, &stat);
|
||||||
if (stat == 1)
|
if (stat == 1)
|
||||||
{
|
{
|
||||||
@@ -172,7 +183,6 @@ static int ec20_set_apn(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tos_at_cmd_exec_until(&echo, 3000, "AT+QIACT=1\r\n");
|
tos_at_cmd_exec_until(&echo, 3000, "AT+QIACT=1\r\n");
|
||||||
if (echo.status != AT_ECHO_STATUS_OK)
|
if (echo.status != AT_ECHO_STATUS_OK)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user