wifi_common.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef APP_MODULES_WIFI_COMMON_H_
  2. #define APP_MODULES_WIFI_COMMON_H_
  3. #include "module.h"
  4. #include "lauxlib.h"
  5. #include "platform.h"
  6. #include "c_string.h"
  7. #include "c_stdlib.h"
  8. #include "c_types.h"
  9. #include "user_interface.h"
  10. #include "user_config.h"
  11. #include "c_stdio.h"
  12. #include "task/task.h"
  13. void wifi_add_sprintf_field(lua_State* L, char* name, char* string, ...);
  14. void wifi_add_int_field(lua_State* L, char* name, lua_Integer integer);
  15. static inline void register_lua_cb(lua_State* L,int* cb_ref)
  16. {
  17. int ref=luaL_ref(L, LUA_REGISTRYINDEX);
  18. if( *cb_ref != LUA_NOREF)
  19. {
  20. luaL_unref(L, LUA_REGISTRYINDEX, *cb_ref);
  21. }
  22. *cb_ref = ref;
  23. }
  24. static inline void unregister_lua_cb(lua_State* L, int* cb_ref)
  25. {
  26. if(*cb_ref != LUA_NOREF)
  27. {
  28. luaL_unref(L, LUA_REGISTRYINDEX, *cb_ref);
  29. *cb_ref = LUA_NOREF;
  30. }
  31. }
  32. void wifi_change_default_host_name(void);
  33. #ifdef NODE_DEBUG
  34. #define EVENT_DBG(...) c_printf(__VA_ARGS__)
  35. #else
  36. #define EVENT_DBG(...) //c_printf(__VA_ARGS__)
  37. #endif
  38. #ifdef WIFI_SDK_EVENT_MONITOR_ENABLE
  39. extern const LUA_REG_TYPE wifi_event_monitor_map[];
  40. void wifi_eventmon_init();
  41. #endif
  42. #ifdef WIFI_STATION_STATUS_MONITOR_ENABLE
  43. int wifi_station_event_mon_start(lua_State* L);
  44. int wifi_station_event_mon_reg(lua_State* L);
  45. void wifi_station_event_mon_stop(lua_State* L);
  46. #endif
  47. #endif /* APP_MODULES_WIFI_COMMON_H_ */