Update at_socket.c

This commit is contained in:
HubretXie 2018-12-07 19:05:24 +08:00 committed by GitHub
parent cd0521d7d2
commit 7ac5bd992f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -715,7 +715,19 @@ __exit:
} }
else 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; return result;