Merge pull request #1884 from linuxhan/master

sal框架,使用at设备,UDP通讯数据无法获得
This commit is contained in:
Bernard Xiong 2018-10-13 13:42:47 +08:00 committed by GitHub
commit aa4d0903c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -775,6 +775,9 @@ int at_sendto(int socket, const void *data, size_t size, int flags, const struct
goto __exit; goto __exit;
} }
sock->state = AT_SOCKET_CONNECT; sock->state = AT_SOCKET_CONNECT;
/* set AT socket receive data callback function */
at_dev_ops->at_set_event_cb(AT_SOCKET_EVT_RECV, at_recv_notice_cb);
at_dev_ops->at_set_event_cb(AT_SOCKET_EVT_CLOSED, at_closed_notice_cb);
} }
if ((len = at_dev_ops->at_send(sock->socket, (char *) data, size, sock->type)) < 0) if ((len = at_dev_ops->at_send(sock->socket, (char *) data, size, sock->type)) < 0)