Преглед изворни кода

1、完善4G关闭后去场景

liyuezong пре 1 година
родитељ
комит
7ac162041d
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 2 2
      pro/src/Cellular.c
  2. 1 1
      pro/src/mqtt.c

+ 2 - 2
pro/src/Cellular.c

@@ -710,7 +710,7 @@ static int cell_deinit(cell_handle_t *h)
 {
     int r=-1;
     char buf[400];
-    r = send_cmd(h, AT_CMD_QIDEACT, NULL, buf, sizeof(buf));
+    r = send_cmd(h, AT_CMD_QIDEACT,  "="CONTEXT_ID, buf, sizeof(buf));
     if(r==AT_OK) {
         return r;
     }
@@ -1302,7 +1302,7 @@ static void* cellular_thread(void *arg)
         }
         else
         {
-            //if(cnt%5==0) cell_deinit(h);
+            if(cnt%10==0) cell_deinit(h);
             reset_var(h);
         }
         UpdateCellularManager(&h->all);

+ 1 - 1
pro/src/mqtt.c

@@ -386,7 +386,7 @@ static int conn_one(mqtt_conn_t *conn)
 
         conn->c = mg_mqtt_connect(&conn->mgr, url, &opts, mqtt_fn, conn);
         if(conn->c) {
-            //mg_mqtt_bind(conn->c);
+           //mg_mqtt_bind(conn->c);
 
             sprintf(conn->ser.cid, "smartPDU_%d\n", h->prod_id);
             my_sub(conn->c, h->prod_id);