Skip to content

Commit

Permalink
Modified wifi module
Browse files Browse the repository at this point in the history
Implement SDK event monitor
Move wifi status event monitor code into seperate file
(app/modules/wifi_eventmon.c)
Modify wifi lua callback registration code.
Add Functions wifi.ap.deauth and wifi.sta.getrssi
Rework wifi event monitor to use tasking interface
fix for Lua coroutine compatibility issue
Made changes Suggested by TerryE

Also, moved code that sets the default host name out of
luaopen_wifi_init and into a separate function and added a post_task_low
entry in it's place.

Replaced some if test then return error lines with
luaL_argcheck
Add check for malloc null return in wifi.eventmon 
to catch out of memory errors
  • Loading branch information
dnc40085 committed Apr 1, 2016
1 parent b735fe7 commit 5e9ab01
Show file tree
Hide file tree
Showing 10 changed files with 798 additions and 205 deletions.
2 changes: 0 additions & 2 deletions app/include/rom.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ void ets_delay_us (uint32_t us);

int ets_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));

int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3)));

void ets_str2macaddr (uint8_t *dst, const char *str);

void ets_timer_disarm (ETSTimer *a);
Expand Down
4 changes: 4 additions & 0 deletions app/include/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ extern void luaL_assertfail(const char *file, int line, const char *message);

//#define WIFI_SMART_ENABLE

#define WIFI_STATION_STATUS_MONITOR_ENABLE
#define WIFI_SDK_EVENT_MONITOR_ENABLE
#define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE

#define STRBUF_DEFAULT_INCREMENT 32

#endif /* __USER_CONFIG_H__ */
2 changes: 1 addition & 1 deletion app/libc/c_stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern void output_redirect(const char *str);
int c_sprintf(char* s,const char *fmt, ...);
#endif

// #define c_vsprintf ets_vsprintf
#define c_vsprintf ets_vsprintf
#define c_printf(...) do { \
unsigned char __print_buf[BUFSIZ]; \
c_sprintf(__print_buf, __VA_ARGS__); \
Expand Down
Loading

0 comments on commit 5e9ab01

Please sign in to comment.