Commit 31b40eeb authored by Daniel Campora's avatar Daniel Campora
Browse files

cc3200: Fix socket recv and recvfrom return value type.

parent 035deae1
...@@ -253,7 +253,7 @@ STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { ...@@ -253,7 +253,7 @@ STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) {
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
int _errno; int _errno;
mp_uint_t ret = wlan_socket_send(self, bufinfo.buf, bufinfo.len, &_errno); mp_int_t ret = wlan_socket_send(self, bufinfo.buf, bufinfo.len, &_errno);
if (ret < 0) { if (ret < 0) {
nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(_errno))); nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(_errno)));
} }
...@@ -268,7 +268,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { ...@@ -268,7 +268,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) {
vstr_t vstr; vstr_t vstr;
vstr_init_len(&vstr, len); vstr_init_len(&vstr, len);
int _errno; int _errno;
mp_uint_t ret = wlan_socket_recv(self, (byte*)vstr.buf, len, &_errno); mp_int_t ret = wlan_socket_recv(self, (byte*)vstr.buf, len, &_errno);
if (ret < 0) { if (ret < 0) {
if (_errno == EAGAIN && self->sock_base.has_timeout) { if (_errno == EAGAIN && self->sock_base.has_timeout) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError, "timed out")); nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError, "timed out"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment