From 1659c0645d27bba297813889fc7d2c118706c74f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 12 May 2017 21:54:32 +0300 Subject: [PATCH] zephyr/modusocket: Add dummy setsockopt() implementation. --- zephyr/modusocket.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zephyr/modusocket.c b/zephyr/modusocket.c index 92d45a0fe2..ad3a7e23b7 100644 --- a/zephyr/modusocket.c +++ b/zephyr/modusocket.c @@ -450,6 +450,13 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); +STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { + (void)n_args; // always 4 + mp_warning("setsockopt() not implemented"); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_setsockopt); + STATIC mp_obj_t socket_makefile(size_t n_args, const mp_obj_t *args) { (void)n_args; return args[0]; @@ -475,6 +482,7 @@ STATIC const mp_map_elem_t socket_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_accept), (mp_obj_t)&socket_accept_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_send), (mp_obj_t)&socket_send_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_recv), (mp_obj_t)&socket_recv_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_setsockopt), (mp_obj_t)&socket_setsockopt_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_read), (mp_obj_t)&mp_stream_read_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), (mp_obj_t)&mp_stream_readinto_obj },