From 7ac5bd992fe4a07342ca720baff27c53aa30cdff Mon Sep 17 00:00:00 2001 From: HubretXie Date: Fri, 7 Dec 2018 19:05:24 +0800 Subject: [PATCH] Update at_socket.c --- components/net/at/at_socket/at_socket.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index 84325c150..80b86f819 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -715,7 +715,19 @@ __exit: } else { - at_do_event_changes(sock, AT_EVENT_ERROR, RT_TRUE); + /* try to read Legacy data */ + /* receive packet list last transmission of remaining data */ + rt_mutex_take(sock->recv_lock, RT_WAITING_FOREVER); + recv_len = at_recvpkt_get(&(sock->recvpkt_list), (char *)mem, len); + rt_mutex_release(sock->recv_lock); + if(recv_len<=0) + { + at_do_event_changes(sock, AT_EVENT_ERROR, RT_TRUE); + } + else + { + result = recv_len; + } } return result; -- GitLab