Explorar el Código

【修改】EC20 细节改动

chenyong hace 7 años
padre
commit
a1fdf3d437
Se han modificado 1 ficheros con 3 adiciones y 22 borrados
  1. 3 22
      at_socket_ec20.c

+ 3 - 22
at_socket_ec20.c

@@ -450,28 +450,9 @@ static int ec20_socket_close(int socket)
     }
     /* default connection timeout is 10 seconds, but it set to 1 seconds is convenient to use.*/
     result = at_exec_cmd(resp, "AT+QICLOSE=%d,1", socket);
-
-    /* result == RT_EOK means close command received, we need to check more resps*/
-    if (result == RT_EOK)
-    {
-        if (at_resp_get_line_by_kw(resp, "OK") != RT_NULL)
-        {
-            goto __exit;
-        }
-        else if (at_resp_get_line_by_kw(resp, "ERROR") != RT_NULL)
-        {
-            LOG_E("socket (%d) close failed, \"ERROR\" returned.", socket);
-            goto __exit;
-        }
-        else
-        {
-            LOG_E("socket (%d) close failed, not \"OK\" OR \"ERROR\" returned.", socket);
-            goto __exit;
-        }
-    }
-    else if (result == -RT_ETIMEOUT)
+    if (result < 0)
     {
-        LOG_E("socket (%d) close failed, wait close OK timeout.", socket);
+        LOG_E("socket (%d) close failed, wait close OK timeout or ERROR.", socket);
     }
 
 __exit:
@@ -1367,7 +1348,7 @@ int ec20_ifconfig(void)
     /* Query the status of the context profile */
     AT_SEND_CMD(resp, 0, 150 * 1000, "AT+QIACT?");
     at_resp_parse_line_args_by_kw(resp, "+QIACT:", "+QIACT: %*[^\"]\"%[^\"]", &resp_arg);
-    LOG_D("ip adress : %s", resp_arg);
+    rt_kprintf("IP adress : %s\n", resp_arg);
 
 __exit:
     if (resp)