diff --git a/user/config_xmacros.h b/user/config_xmacros.h index bad4d18..9da5daf 100644 --- a/user/config_xmacros.h +++ b/user/config_xmacros.h @@ -82,4 +82,7 @@ enum xset_result xset_string(const char *name, char *field, const char *buff, co #define XGET_CGI_FUNC(type, name, suffix, deref, xget, cast, xset, xsarg, xnotify) \ if (streq(token, #name)) xget(buff, deref wificonf->name); +#define XSTRUCT_FIELD(type, name, suffix, deref, xget, cast, xset, xsarg, xnotify) \ + type name suffix; + #endif //ESPTERM_CONFIG_XMACROS_H diff --git a/user/wifimgr.h b/user/wifimgr.h index a90510f..2302571 100644 --- a/user/wifimgr.h +++ b/user/wifimgr.h @@ -8,6 +8,7 @@ #define ESP_VT100_FIRMWARE_WIFI_MANAGER_H #include +#include "config_xmacros.h" #include "cgi_wifi.h" #define SSID_LEN 32 @@ -64,14 +65,8 @@ * This block can be used eg. for WiFi config backup. */ typedef struct { -#define X( \ - type, name, suffix, \ - deref, xget, \ - cast, xset, xsarg, \ - xnotify) type name suffix; - +#define X XSTRUCT_FIELD XTABLE_WIFI - #undef X } WiFiConfigBundle;