Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
4fa7d36c
Commit
4fa7d36c
authored
May 02, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esp32: Use mp_rom_map_elem_t and MP_ROM_xxx macros for const dicts.
parent
6681eb80
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
94 deletions
+81
-94
ports/esp32/machine_rtc.c
ports/esp32/machine_rtc.c
+4
-4
ports/esp32/machine_timer.c
ports/esp32/machine_timer.c
+5
-5
ports/esp32/machine_wdt.c
ports/esp32/machine_wdt.c
+2
-2
ports/esp32/modnetwork.c
ports/esp32/modnetwork.c
+31
-44
ports/esp32/modsocket.c
ports/esp32/modsocket.c
+39
-39
No files found.
ports/esp32/machine_rtc.c
View file @
4fa7d36c
...
...
@@ -147,10 +147,10 @@ STATIC mp_obj_t machine_rtc_memory(mp_uint_t n_args, const mp_obj_t *args) {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
machine_rtc_memory_obj
,
1
,
2
,
machine_rtc_memory
);
STATIC
const
mp_map_elem_t
machine_rtc_locals_dict_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_init
),
(
mp_obj_t
)
&
machine_rtc_datetime_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_datetime
),
(
mp_obj_t
)
&
machine_rtc_datetime_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_memory
),
(
mp_obj_t
)
&
machine_rtc_memory_obj
},
STATIC
const
mp_
rom_
map_elem_t
machine_rtc_locals_dict_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR_init
),
MP_ROM_PTR
(
&
machine_rtc_datetime_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_datetime
),
MP_ROM_PTR
(
&
machine_rtc_datetime_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_memory
),
MP_ROM_PTR
(
&
machine_rtc_memory_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
machine_rtc_locals_dict
,
machine_rtc_locals_dict_table
);
...
...
ports/esp32/machine_timer.c
View file @
4fa7d36c
...
...
@@ -173,11 +173,11 @@ STATIC mp_obj_t machine_timer_value(mp_obj_t self_in) {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
machine_timer_value_obj
,
machine_timer_value
);
STATIC
const
mp_map_elem_t
machine_timer_locals_dict_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___del__
),
(
mp_obj_t
)
&
machine_timer_deinit_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_deinit
),
(
mp_obj_t
)
&
machine_timer_deinit_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_init
),
(
mp_obj_t
)
&
machine_timer_init_obj
},
{
MP_ROM_QSTR
(
MP_QSTR_value
),
(
mp_obj_t
)
&
machine_timer_value_obj
},
STATIC
const
mp_
rom_
map_elem_t
machine_timer_locals_dict_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___del__
),
MP_ROM_PTR
(
&
machine_timer_deinit_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_deinit
),
MP_ROM_PTR
(
&
machine_timer_deinit_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_init
),
MP_ROM_PTR
(
&
machine_timer_init_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_value
),
MP_ROM_PTR
(
&
machine_timer_value_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_ONE_SHOT
),
MP_ROM_INT
(
false
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PERIODIC
),
MP_ROM_INT
(
true
)
},
};
...
...
ports/esp32/machine_wdt.c
View file @
4fa7d36c
...
...
@@ -65,8 +65,8 @@ STATIC mp_obj_t machine_wdt_feed(mp_obj_t self_in) {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
machine_wdt_feed_obj
,
machine_wdt_feed
);
STATIC
const
mp_map_elem_t
machine_wdt_locals_dict_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_feed
),
(
mp_obj_t
)
&
machine_wdt_feed_obj
},
STATIC
const
mp_
rom_
map_elem_t
machine_wdt_locals_dict_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR_feed
),
MP_ROM_PTR
(
&
machine_wdt_feed_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
machine_wdt_locals_dict
,
machine_wdt_locals_dict_table
);
...
...
ports/esp32/modnetwork.c
View file @
4fa7d36c
...
...
@@ -551,15 +551,15 @@ unknown:
STATIC
MP_DEFINE_CONST_FUN_OBJ_KW
(
esp_config_obj
,
1
,
esp_config
);
STATIC
const
mp_map_elem_t
wlan_if_locals_dict_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_active
),
(
mp_obj_t
)
&
esp_active_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_connect
),
(
mp_obj_t
)
&
esp_connect_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_disconnect
),
(
mp_obj_t
)
&
esp_disconnect_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_status
),
(
mp_obj_t
)
&
esp_status_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_scan
),
(
mp_obj_t
)
&
esp_scan_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_isconnected
),
(
mp_obj_t
)
&
esp_isconnected_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_config
),
(
mp_obj_t
)
&
esp_config_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_ifconfig
),
(
mp_obj_t
)
&
esp_ifconfig_obj
},
STATIC
const
mp_
rom_
map_elem_t
wlan_if_locals_dict_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR_active
),
MP_ROM_PTR
(
&
esp_active_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_connect
),
MP_ROM_PTR
(
&
esp_connect_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_disconnect
),
MP_ROM_PTR
(
&
esp_disconnect_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_status
),
MP_ROM_PTR
(
&
esp_status_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_scan
),
MP_ROM_PTR
(
&
esp_scan_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_isconnected
),
MP_ROM_PTR
(
&
esp_isconnected_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_config
),
MP_ROM_PTR
(
&
esp_config_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_ifconfig
),
MP_ROM_PTR
(
&
esp_ifconfig_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
wlan_if_locals_dict
,
wlan_if_locals_dict_table
);
...
...
@@ -576,43 +576,30 @@ STATIC mp_obj_t esp_phy_mode(size_t n_args, const mp_obj_t *args) {
STATIC
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
esp_phy_mode_obj
,
0
,
1
,
esp_phy_mode
);
STATIC
const
mp_map_elem_t
mp_module_network_globals_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW
_QSTR
(
MP_QSTR_network
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR___init__
),
(
mp_obj_t
)
&
esp_initialize_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_WLAN
),
(
mp_obj_t
)
&
get_wlan_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_LAN
),
(
mp_obj_t
)
&
get_lan_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_phy_mode
),
(
mp_obj_t
)
&
esp_phy_mode_obj
},
STATIC
const
mp_
rom_
map_elem_t
mp_module_network_globals_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM
_QSTR
(
MP_QSTR_network
)
},
{
MP_
ROM_QSTR
(
MP_QSTR___init__
),
MP_ROM_PTR
(
&
esp_initialize_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_WLAN
),
MP_ROM_PTR
(
&
get_wlan_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_LAN
),
MP_ROM_PTR
(
&
get_lan_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_phy_mode
),
MP_ROM_PTR
(
&
esp_phy_mode_obj
)
},
#if MODNETWORK_INCLUDE_CONSTANTS
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_STA_IF
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_IF_STA
)},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AP_IF
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_IF_AP
)},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_MODE_11B
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_PROTOCOL_11B
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_MODE_11G
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_PROTOCOL_11G
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_MODE_11N
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_PROTOCOL_11N
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_OPEN
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_OPEN
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_WEP
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_WEP
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_WPA_PSK
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_WPA_PSK
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_WPA2_PSK
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_WPA2_PSK
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_WPA_WPA2_PSK
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_WPA_WPA2_PSK
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_AUTH_MAX
),
MP_OBJ_NEW_SMALL_INT
(
WIFI_AUTH_MAX
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_PHY_LAN8720
),
MP_OBJ_NEW_SMALL_INT
(
PHY_LAN8720
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_PHY_TLK110
),
MP_OBJ_NEW_SMALL_INT
(
PHY_TLK110
)
},
{
MP_ROM_QSTR
(
MP_QSTR_STA_IF
),
MP_ROM_INT
(
WIFI_IF_STA
)},
{
MP_ROM_QSTR
(
MP_QSTR_AP_IF
),
MP_ROM_INT
(
WIFI_IF_AP
)},
{
MP_ROM_QSTR
(
MP_QSTR_MODE_11B
),
MP_ROM_INT
(
WIFI_PROTOCOL_11B
)
},
{
MP_ROM_QSTR
(
MP_QSTR_MODE_11G
),
MP_ROM_INT
(
WIFI_PROTOCOL_11G
)
},
{
MP_ROM_QSTR
(
MP_QSTR_MODE_11N
),
MP_ROM_INT
(
WIFI_PROTOCOL_11N
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_OPEN
),
MP_ROM_INT
(
WIFI_AUTH_OPEN
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_WEP
),
MP_ROM_INT
(
WIFI_AUTH_WEP
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_WPA_PSK
),
MP_ROM_INT
(
WIFI_AUTH_WPA_PSK
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_WPA2_PSK
),
MP_ROM_INT
(
WIFI_AUTH_WPA2_PSK
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_WPA_WPA2_PSK
),
MP_ROM_INT
(
WIFI_AUTH_WPA_WPA2_PSK
)
},
{
MP_ROM_QSTR
(
MP_QSTR_AUTH_MAX
),
MP_ROM_INT
(
WIFI_AUTH_MAX
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PHY_LAN8720
),
MP_ROM_INT
(
PHY_LAN8720
)
},
{
MP_ROM_QSTR
(
MP_QSTR_PHY_TLK110
),
MP_ROM_INT
(
PHY_TLK110
)
},
#endif
};
...
...
ports/esp32/modsocket.c
View file @
4fa7d36c
...
...
@@ -567,28 +567,28 @@ STATIC mp_uint_t socket_stream_ioctl(mp_obj_t self_in, mp_uint_t request, uintpt
return
MP_STREAM_ERROR
;
}
STATIC
const
mp_map_elem_t
socket_locals_dict_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR___del__
),
(
mp_obj_t
)
&
mp_stream_close_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_close
),
(
mp_obj_t
)
&
mp_stream_close_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_bind
),
(
mp_obj_t
)
&
socket_bind_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_listen
),
(
mp_obj_t
)
&
socket_listen_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_accept
),
(
mp_obj_t
)
&
socket_accept_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_connect
),
(
mp_obj_t
)
&
socket_connect_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_send
),
(
mp_obj_t
)
&
socket_send_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_sendall
),
(
mp_obj_t
)
&
socket_sendall_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_sendto
),
(
mp_obj_t
)
&
socket_sendto_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_recv
),
(
mp_obj_t
)
&
socket_recv_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_recvfrom
),
(
mp_obj_t
)
&
socket_recvfrom_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_setsockopt
),
(
mp_obj_t
)
&
socket_setsockopt_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_settimeout
),
(
mp_obj_t
)
&
socket_settimeout_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_setblocking
),
(
mp_obj_t
)
&
socket_setblocking_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_makefile
),
(
mp_obj_t
)
&
socket_makefile_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_fileno
),
(
mp_obj_t
)
&
socket_fileno_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
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_readline
),
(
mp_obj_t
)
&
mp_stream_unbuffered_readline_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_write
),
(
mp_obj_t
)
&
mp_stream_write_obj
},
STATIC
const
mp_
rom_
map_elem_t
socket_locals_dict_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR___del__
),
MP_ROM_PTR
(
&
mp_stream_close_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_close
),
MP_ROM_PTR
(
&
mp_stream_close_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_bind
),
MP_ROM_PTR
(
&
socket_bind_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_listen
),
MP_ROM_PTR
(
&
socket_listen_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_accept
),
MP_ROM_PTR
(
&
socket_accept_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_connect
),
MP_ROM_PTR
(
&
socket_connect_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_send
),
MP_ROM_PTR
(
&
socket_send_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_sendall
),
MP_ROM_PTR
(
&
socket_sendall_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_sendto
),
MP_ROM_PTR
(
&
socket_sendto_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_recv
),
MP_ROM_PTR
(
&
socket_recv_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_recvfrom
),
MP_ROM_PTR
(
&
socket_recvfrom_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_setsockopt
),
MP_ROM_PTR
(
&
socket_setsockopt_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_settimeout
),
MP_ROM_PTR
(
&
socket_settimeout_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_setblocking
),
MP_ROM_PTR
(
&
socket_setblocking_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_makefile
),
MP_ROM_PTR
(
&
socket_makefile_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_fileno
),
MP_ROM_PTR
(
&
socket_fileno_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_read
),
MP_ROM_PTR
(
&
mp_stream_read_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_readinto
),
MP_ROM_PTR
(
&
mp_stream_readinto_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_readline
),
MP_ROM_PTR
(
&
mp_stream_unbuffered_readline_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_write
),
MP_ROM_PTR
(
&
mp_stream_write_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
socket_locals_dict
,
socket_locals_dict_table
);
...
...
@@ -679,23 +679,23 @@ STATIC mp_obj_t esp_socket_initialize() {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
esp_socket_initialize_obj
,
esp_socket_initialize
);
STATIC
const
mp_map_elem_t
mp_module_socket_globals_table
[]
=
{
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW
_QSTR
(
MP_QSTR_usocket
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR___init__
),
(
mp_obj_t
)
&
esp_socket_initialize_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_socket
),
(
mp_obj_t
)
&
get_socket_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_getaddrinfo
),
(
mp_obj_t
)
&
esp_socket_getaddrinfo_obj
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_AF_INET
),
MP_OBJ_NEW_SMALL
_INT
(
AF_INET
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_AF_INET6
),
MP_OBJ_NEW_SMALL
_INT
(
AF_INET6
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_SOCK_STREAM
),
MP_OBJ_NEW_SMALL
_INT
(
SOCK_STREAM
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_SOCK_DGRAM
),
MP_OBJ_NEW_SMALL
_INT
(
SOCK_DGRAM
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_SOCK_RAW
),
MP_OBJ_NEW_SMALL
_INT
(
SOCK_RAW
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_IPPROTO_TCP
),
MP_OBJ_NEW_SMALL
_INT
(
IPPROTO_TCP
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_IPPROTO_UDP
),
MP_OBJ_NEW_SMALL
_INT
(
IPPROTO_UDP
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_IPPROTO_IP
),
MP_OBJ_NEW_SMALL
_INT
(
IPPROTO_IP
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_SOL_SOCKET
),
MP_OBJ_NEW_SMALL
_INT
(
SOL_SOCKET
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_SO_REUSEADDR
),
MP_OBJ_NEW_SMALL
_INT
(
SO_REUSEADDR
)
},
{
MP_
OBJ_NEW_QSTR
(
MP_QSTR_IP_ADD_MEMBERSHIP
),
MP_OBJ_NEW_SMALL
_INT
(
IP_ADD_MEMBERSHIP
)
},
STATIC
const
mp_
rom_
map_elem_t
mp_module_socket_globals_table
[]
=
{
{
MP_
ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM
_QSTR
(
MP_QSTR_usocket
)
},
{
MP_
ROM_QSTR
(
MP_QSTR___init__
),
MP_ROM_PTR
(
&
esp_socket_initialize_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_socket
),
MP_ROM_PTR
(
&
get_socket_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_getaddrinfo
),
MP_ROM_PTR
(
&
esp_socket_getaddrinfo_obj
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_AF_INET
),
MP_ROM
_INT
(
AF_INET
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_AF_INET6
),
MP_ROM
_INT
(
AF_INET6
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_SOCK_STREAM
),
MP_ROM
_INT
(
SOCK_STREAM
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_SOCK_DGRAM
),
MP_ROM
_INT
(
SOCK_DGRAM
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_SOCK_RAW
),
MP_ROM
_INT
(
SOCK_RAW
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_IPPROTO_TCP
),
MP_ROM
_INT
(
IPPROTO_TCP
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_IPPROTO_UDP
),
MP_ROM
_INT
(
IPPROTO_UDP
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_IPPROTO_IP
),
MP_ROM
_INT
(
IPPROTO_IP
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_SOL_SOCKET
),
MP_ROM
_INT
(
SOL_SOCKET
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_SO_REUSEADDR
),
MP_ROM
_INT
(
SO_REUSEADDR
)
},
{
MP_
ROM_QSTR
(
MP_QSTR_IP_ADD_MEMBERSHIP
),
MP_ROM
_INT
(
IP_ADD_MEMBERSHIP
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
mp_module_socket_globals
,
mp_module_socket_globals_table
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment