Parcourir la source

fix: mqtt,掉线的回调,应该用整形,而非浮点数

Wendal Chen il y a 1 an
Parent
commit
40a490f6bf
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      components/network/libemqtt/luat_lib_mqtt.c

+ 2 - 2
components/network/libemqtt/luat_lib_mqtt.c

@@ -180,14 +180,14 @@ int32_t luatos_mqtt_callback(lua_State *L, void* ptr){
 				if (lua_isfunction(L, -1)) {
 					lua_geti(L, LUA_REGISTRYINDEX, mqtt_ctrl->mqtt_ref);
 					lua_pushstring(L, "disconnect");
-					lua_pushnumber(L, mqtt_ctrl->error_state);
+					lua_pushinteger(L, mqtt_ctrl->error_state);
 					lua_call(L, 3, 0);
 				}
 				lua_getglobal(L, "sys_pub");
 				if (lua_isfunction(L, -1)) {
 					lua_pushstring(L, "MQTT_DISCONNECT");
 					lua_geti(L, LUA_REGISTRYINDEX, mqtt_ctrl->mqtt_ref);
-					lua_pushnumber(L, mqtt_ctrl->error_state);
+					lua_pushinteger(L, mqtt_ctrl->error_state);
 					lua_call(L, 3, 0);
 				}
             }