@@ -61,7 +61,6 @@ static int air724_signal_quality_check(void)
|
|||||||
char echo_buffer[32], *str;
|
char echo_buffer[32], *str;
|
||||||
int try = 0;
|
int try = 0;
|
||||||
|
|
||||||
|
|
||||||
while (try++ < 10)
|
while (try++ < 10)
|
||||||
{
|
{
|
||||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||||
@@ -72,6 +71,10 @@ static int air724_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;
|
||||||
@@ -97,6 +100,10 @@ static int air724_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)
|
||||||
{
|
{
|
||||||
@@ -123,6 +130,10 @@ static int air724_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)
|
||||||
{
|
{
|
||||||
@@ -464,6 +475,10 @@ static int air724_parse_domain(const char *host_name, char *host_ip, size_t host
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
str = strstr(echo.buffer, ":");
|
str = strstr(echo.buffer, ":");
|
||||||
|
if (!str)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
str += 1;
|
str += 1;
|
||||||
if(*str == '0')
|
if(*str == '0')
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user