Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
bcaf98f8
Commit
bcaf98f8
authored
Jul 21, 2021
by
Johny Mattsson
Browse files
idf4: part 2.2 - obligatory missed API call
Plus addressing some warnings.
parent
d2f8121e
Changes
2
Show whitespace changes
Inline
Side-by-side
components/modules/net.c
View file @
bcaf98f8
...
@@ -249,6 +249,7 @@ lnet_userdata *net_create( lua_State *L, enum net_type type ) {
...
@@ -249,6 +249,7 @@ lnet_userdata *net_create( lua_State *L, enum net_type type ) {
ud
->
client
.
cb_reconnect_ref
=
LUA_NOREF
;
ud
->
client
.
cb_reconnect_ref
=
LUA_NOREF
;
ud
->
client
.
cb_disconnect_ref
=
LUA_NOREF
;
ud
->
client
.
cb_disconnect_ref
=
LUA_NOREF
;
ud
->
client
.
connecting
=
false
;
ud
->
client
.
connecting
=
false
;
// fall-through
case
TYPE_UDP_SOCKET
:
case
TYPE_UDP_SOCKET
:
ud
->
client
.
wait_dns
=
0
;
ud
->
client
.
wait_dns
=
0
;
ud
->
client
.
cb_dns_ref
=
LUA_NOREF
;
ud
->
client
.
cb_dns_ref
=
LUA_NOREF
;
...
@@ -572,6 +573,7 @@ static int net_on( lua_State *L ) {
...
@@ -572,6 +573,7 @@ static int net_on( lua_State *L ) {
{
refptr
=
&
ud
->
client
.
cb_disconnect_ref
;
break
;
}
{
refptr
=
&
ud
->
client
.
cb_disconnect_ref
;
break
;
}
if
(
strcmp
(
"reconnection"
,
name
)
==
0
)
if
(
strcmp
(
"reconnection"
,
name
)
==
0
)
{
refptr
=
&
ud
->
client
.
cb_reconnect_ref
;
break
;
}
{
refptr
=
&
ud
->
client
.
cb_reconnect_ref
;
break
;
}
// fall-through
case
TYPE_UDP_SOCKET
:
case
TYPE_UDP_SOCKET
:
if
(
strcmp
(
"dns"
,
name
)
==
0
)
if
(
strcmp
(
"dns"
,
name
)
==
0
)
{
refptr
=
&
ud
->
client
.
cb_dns_ref
;
break
;
}
{
refptr
=
&
ud
->
client
.
cb_dns_ref
;
break
;
}
...
@@ -804,6 +806,7 @@ static int net_delete( lua_State *L ) {
...
@@ -804,6 +806,7 @@ static int net_delete( lua_State *L ) {
ud
->
client
.
cb_disconnect_ref
=
LUA_NOREF
;
ud
->
client
.
cb_disconnect_ref
=
LUA_NOREF
;
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
client
.
cb_reconnect_ref
);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
client
.
cb_reconnect_ref
);
ud
->
client
.
cb_reconnect_ref
=
LUA_NOREF
;
ud
->
client
.
cb_reconnect_ref
=
LUA_NOREF
;
// fall-through
case
TYPE_UDP_SOCKET
:
case
TYPE_UDP_SOCKET
:
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
client
.
cb_dns_ref
);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
client
.
cb_dns_ref
);
ud
->
client
.
cb_dns_ref
=
LUA_NOREF
;
ud
->
client
.
cb_dns_ref
=
LUA_NOREF
;
...
...
components/modules/wifi_ap.c
View file @
bcaf98f8
...
@@ -190,7 +190,7 @@ static int wifi_ap_sethostname(lua_State *L)
...
@@ -190,7 +190,7 @@ static int wifi_ap_sethostname(lua_State *L)
esp_err_t
err
;
esp_err_t
err
;
const
char
*
hostname
=
luaL_checklstring
(
L
,
1
,
&
l
);
const
char
*
hostname
=
luaL_checklstring
(
L
,
1
,
&
l
);
err
=
tcpip_adapter
_set_hostname
(
TCPIP_ADAPTER_IF_AP
,
hostname
);
err
=
esp_netif
_set_hostname
(
wifi_ap
,
hostname
);
if
(
err
!=
ESP_OK
)
if
(
err
!=
ESP_OK
)
return
luaL_error
(
L
,
"failed to set hostname, code %d"
,
err
);
return
luaL_error
(
L
,
"failed to set hostname, code %d"
,
err
);
...
...
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