Browse Source

[at]优先判断是否是URC数据

yangpeng 1 year ago
parent
commit
8012c0c9a2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      components/net/at/src/at_client.c

+ 2 - 2
components/net/at/src/at_client.c

@@ -698,8 +698,8 @@ static int at_recv_readline(at_client_t client)
         }
 
         /* is newline or URC data */
-        if ((ch == '\n' && last_ch == '\r') || (client->end_sign != 0 && ch == client->end_sign)
-                || (client->urc = get_urc_obj(client)) != RT_NULL)
+        if ((client->urc = get_urc_obj(client)) != RT_NULL || (ch == '\n' && last_ch == '\r')
+                || (client->end_sign != 0 && ch == client->end_sign))
         {
             if (is_full)
             {