瀏覽代碼

update: 统一wlan的状态消息

Wendal Chen 1 年之前
父節點
當前提交
c18678ce18
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      luatos/components/luat/port/luat_wlan_idf5.c

+ 6 - 0
luatos/components/luat/port/luat_wlan_idf5.c

@@ -162,6 +162,9 @@ static int l_wlan_handler(lua_State *L, void* ptr) {
             LLOGD("wifi connected!!!");
             lua_pushstring(L, "WLAN_STA_CONNECTED");
             lua_call(L, 1, 0);
+            lua_pushstring(L, "WLAN_STATUS");
+            lua_pushinteger(L, 1);
+            lua_call(L, 2, 0);
             if (!dhcp_enable) {
                 LLOGD("dhcp is disabled, static ip, send IP_READY");
                 lua_getglobal(L, "sys_pub");
@@ -176,6 +179,9 @@ static int l_wlan_handler(lua_State *L, void* ptr) {
             LLOGD("wifi disconnected!!!");
             lua_pushstring(L, "WLAN_STA_DISCONNECTED");
             lua_call(L, 1, 0);
+            lua_pushstring(L, "WLAN_STATUS");
+            lua_pushinteger(L, 0);
+            lua_call(L, 2, 0);
             lua_getglobal(L, "sys_pub");
             lua_pushstring(L, "WLAN_READY");
             lua_pushinteger(L, 0);