idf4: part 2.2 - obligatory missed API call

Plus addressing some warnings.
This commit is contained in:
Johny Mattsson 2021-07-21 12:30:51 +10:00
parent d2f8121e22
commit bcaf98f8f0
2 changed files with 4 additions and 1 deletions

View File

@ -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_disconnect_ref = LUA_NOREF;
ud->client.connecting = false;
// fall-through
case TYPE_UDP_SOCKET:
ud->client.wait_dns = 0;
ud->client.cb_dns_ref = LUA_NOREF;
@ -572,6 +573,7 @@ static int net_on( lua_State *L ) {
{ refptr = &ud->client.cb_disconnect_ref; break; }
if (strcmp("reconnection",name)==0)
{ refptr = &ud->client.cb_reconnect_ref; break; }
// fall-through
case TYPE_UDP_SOCKET:
if (strcmp("dns",name)==0)
{ refptr = &ud->client.cb_dns_ref; break; }
@ -804,6 +806,7 @@ static int net_delete( lua_State *L ) {
ud->client.cb_disconnect_ref = LUA_NOREF;
luaL_unref(L, LUA_REGISTRYINDEX, ud->client.cb_reconnect_ref);
ud->client.cb_reconnect_ref = LUA_NOREF;
// fall-through
case TYPE_UDP_SOCKET:
luaL_unref(L, LUA_REGISTRYINDEX, ud->client.cb_dns_ref);
ud->client.cb_dns_ref = LUA_NOREF;

View File

@ -190,7 +190,7 @@ static int wifi_ap_sethostname(lua_State *L)
esp_err_t err;
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)
return luaL_error (L, "failed to set hostname, code %d", err);