Browse Source

extmod/modlwip: Implement dummy setsockopt().

pull/1876/head
Paul Sokolovsky 9 years ago
parent
commit
ed593780bf
  1. 9
      extmod/modlwip.c
  2. 1
      py/qstrdefs.h

9
extmod/modlwip.c

@ -27,6 +27,7 @@
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include "py/nlr.h"
#include "py/objlist.h"
@ -870,6 +871,13 @@ STATIC mp_obj_t lwip_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(lwip_socket_settimeout_obj, lwip_socket_settimeout);
STATIC mp_obj_t lwip_socket_setsockopt(mp_uint_t n_args, const mp_obj_t *args) {
(void)n_args; // always 4
printf("Warning: lwip.setsockopt() not implemented\n");
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(lwip_socket_setsockopt_obj, 4, 4, lwip_socket_setsockopt);
STATIC const mp_map_elem_t lwip_socket_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___del__), (mp_obj_t)&lwip_socket_close_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_close), (mp_obj_t)&lwip_socket_close_obj },
@ -882,6 +890,7 @@ STATIC const mp_map_elem_t lwip_socket_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_sendto), (mp_obj_t)&lwip_socket_sendto_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_recvfrom), (mp_obj_t)&lwip_socket_recvfrom_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_settimeout), (mp_obj_t)&lwip_socket_settimeout_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_setsockopt), (mp_obj_t)&lwip_socket_setsockopt_obj },
};
STATIC MP_DEFINE_CONST_DICT(lwip_socket_locals_dict, lwip_socket_locals_dict_table);

1
py/qstrdefs.h

@ -705,6 +705,7 @@ Q(recv)
Q(sendto)
Q(recvfrom)
Q(settimeout)
Q(setsockopt)
#if MICROPY_PY_LWIP_SLIP
// for lwip.slip
Q(slip)

Loading…
Cancel
Save