|
|
@@ -56,6 +56,9 @@
|
|
|
|
|
|
#define SMS_SEND_MAX 100
|
|
|
|
|
|
+#define UNLINK_MAX 3
|
|
|
+
|
|
|
+int UnLinkCount=0;
|
|
|
|
|
|
enum {
|
|
|
AT_OK=0,
|
|
|
@@ -829,9 +832,11 @@ static int cell_get_ping(cell_handle_t *h, cell_stat_t *stat)
|
|
|
char buf[200],utc[32],date[32];
|
|
|
|
|
|
if(h->stat==AT_STAT_UNINIT) {
|
|
|
+ stat->linked = 0;
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
r = send_cmd(h, AT_CMD_QPING, "=1,\"www.baidu.com\",3,2,", buf, sizeof(buf));
|
|
|
if(r!=AT_OK) {
|
|
|
stat->linked = 0;
|
|
|
@@ -844,13 +849,33 @@ static int cell_get_ping(cell_handle_t *h, cell_stat_t *stat)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- LOGD("QPING: %d\n", ret);
|
|
|
if(ret==0) {
|
|
|
stat->linked = 1;
|
|
|
}
|
|
|
else {
|
|
|
stat->linked = 0;
|
|
|
}
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ r = send_cmd(h, AT_CMD_CGATT, "?", buf, sizeof(buf));
|
|
|
+ if(r!=AT_OK) {
|
|
|
+ stat->linked = 0;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ r = sscanf(str_get(buf,'+'), "+CGATT: %d", &ret);
|
|
|
+ if(r<1) {
|
|
|
+ stat->linked = 0;
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ret==1) {
|
|
|
+ stat->linked = 1;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ stat->linked = 0;
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
static int cell_get_time(cell_handle_t *h, cell_stat_t *stat)
|