Browse Source

cc3200: Fix socket recv and recvfrom return value type.

pull/1358/merge
Daniel Campora 9 years ago
parent
commit
31b40eebe8
  1. 4
      cc3200/mods/modusocket.c

4
cc3200/mods/modusocket.c

@ -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_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
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) {
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) {
vstr_t vstr;
vstr_init_len(&vstr, len);
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 (_errno == EAGAIN && self->sock_base.has_timeout) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError, "timed out"));

Loading…
Cancel
Save