diff options
| author | Yonatan Goldschmidt | 2019-02-10 22:35:18 +0200 |
|---|---|---|
| committer | Damien George | 2019-02-14 00:35:45 +1100 |
| commit | bc4f8b438b56cf1b4f6b44febcd0d83599cbbd68 (patch) | |
| tree | 48a549df981c2471d12cdbe9f135f90b37cf9878 /extmod | |
| parent | d1acca3c71780545e067e85b444b495cc9801b2b (diff) | |
extmod/moduwebsocket: Refactor `websocket` to `uwebsocket`.
As mentioned in #4450, `websocket` was experimental with a single intended
user, `webrepl`. Therefore, we'll make this change without a weak
link `websocket` -> `uwebsocket`.
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/moduwebsocket.c (renamed from extmod/modwebsocket.c) | 16 | ||||
| -rw-r--r-- | extmod/moduwebsocket.h | 10 | ||||
| -rw-r--r-- | extmod/modwebrepl.c | 2 | ||||
| -rw-r--r-- | extmod/modwebsocket.h | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/extmod/modwebsocket.c b/extmod/moduwebsocket.c index c556f2b77..eb5e20c6e 100644 --- a/extmod/modwebsocket.c +++ b/extmod/moduwebsocket.c @@ -30,9 +30,9 @@ #include "py/runtime.h" #include "py/stream.h" -#include "extmod/modwebsocket.h" +#include "extmod/moduwebsocket.h" -#if MICROPY_PY_WEBSOCKET +#if MICROPY_PY_UWEBSOCKET enum { FRAME_HEADER, FRAME_OPT, PAYLOAD, CONTROL }; @@ -299,16 +299,16 @@ STATIC const mp_obj_type_t websocket_type = { .locals_dict = (void*)&websocket_locals_dict, }; -STATIC const mp_rom_map_elem_t websocket_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_websocket) }, +STATIC const mp_rom_map_elem_t uwebsocket_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uwebsocket) }, { MP_ROM_QSTR(MP_QSTR_websocket), MP_ROM_PTR(&websocket_type) }, }; -STATIC MP_DEFINE_CONST_DICT(websocket_module_globals, websocket_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(uwebsocket_module_globals, uwebsocket_module_globals_table); -const mp_obj_module_t mp_module_websocket = { +const mp_obj_module_t mp_module_uwebsocket = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&websocket_module_globals, + .globals = (mp_obj_dict_t*)&uwebsocket_module_globals, }; -#endif // MICROPY_PY_WEBSOCKET +#endif // MICROPY_PY_UWEBSOCKET diff --git a/extmod/moduwebsocket.h b/extmod/moduwebsocket.h new file mode 100644 index 000000000..c1ea291ed --- /dev/null +++ b/extmod/moduwebsocket.h @@ -0,0 +1,10 @@ +#ifndef MICROPY_INCLUDED_EXTMOD_MODUWEBSOCKET_H +#define MICROPY_INCLUDED_EXTMOD_MODUWEBSOCKET_H + +#define FRAME_OPCODE_MASK 0x0f +enum { + FRAME_CONT, FRAME_TXT, FRAME_BIN, + FRAME_CLOSE = 0x8, FRAME_PING, FRAME_PONG +}; + +#endif // MICROPY_INCLUDED_EXTMOD_MODUWEBSOCKET_H diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index 3c33ee150..bf0c1654b 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -34,7 +34,7 @@ #ifdef MICROPY_PY_WEBREPL_DELAY #include "py/mphal.h" #endif -#include "extmod/modwebsocket.h" +#include "extmod/moduwebsocket.h" #if MICROPY_PY_WEBREPL diff --git a/extmod/modwebsocket.h b/extmod/modwebsocket.h deleted file mode 100644 index 2720147df..000000000 --- a/extmod/modwebsocket.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H -#define MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H - -#define FRAME_OPCODE_MASK 0x0f -enum { - FRAME_CONT, FRAME_TXT, FRAME_BIN, - FRAME_CLOSE = 0x8, FRAME_PING, FRAME_PONG -}; - -#endif // MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H |
