|
1 |
| -/**************************************************************************************************************************** |
2 |
| - WiFiManager_RT8720_Debug.h |
3 |
| - For RTL8720DN, RTL8722DM, RTM8722CSM, etc. boards |
| 1 | +/******************************************************************************************************************************* |
| 2 | + WiFiManager_RTL8720.h |
| 3 | + |
| 4 | + For RTL8720DN, RTL8722DM, RTL8722CSM, etc. boards |
4 | 5 |
|
5 |
| - WiFiManager_RT8720 (https://github.com/khoih-prog/WiFiManager_RT8720) is a library |
6 |
| - for the RTL8720DN, RTL8722DM, RTM8722CSM, etc. boards to enable store Credentials in EEPROM/SPIFFS/LittleFS for easy |
7 |
| - configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding. |
| 6 | + WiFiManager_RTL8720 (https://github.com/khoih-prog/WiFiManager_RTL8720) is a library |
| 7 | + for the RTL8720DN, RTL8722DM, RTL8722CSM, etc. boards to enable store Credentials in FlashStorage for easy |
| 8 | + configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding |
8 | 9 |
|
9 |
| - Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_RT8720 |
| 10 | + Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_RTL8720 |
10 | 11 | Licensed under MIT license
|
11 | 12 |
|
12 | 13 | Version: 1.0.0
|
13 | 14 |
|
14 | 15 | Version Modified By Date Comments
|
15 | 16 | ------- ----------- ---------- -----------
|
16 |
| - 1.0.0 K Hoang 04/02/2021 Initial coding for RTL8720DN, RTL8722DM, RTM8722CSM, etc. |
17 |
| - *****************************************************************************************************************************/ |
| 17 | + 1.0.0 K Hoang 18/05/2022 Initial coding for RTL8720DN, RTL8722DM, RTL8722CSM, etc. |
| 18 | + ********************************************************************************************************************************/ |
18 | 19 |
|
19 |
| -#ifndef WiFiManager_RT8720_Debug_h |
20 |
| -#define WiFiManager_RT8720_Debug_h |
| 20 | +#ifndef WiFiManager_RTL8720_Debug_h |
| 21 | +#define WiFiManager_RTL8720_Debug_h |
21 | 22 |
|
22 |
| -#ifdef RT8720_DEBUG_OUTPUT |
23 |
| - #define DBG_PORT_RT8720 RT8720_DEBUG_OUTPUT |
| 23 | +#ifdef WIFI_GENERIC_DEBUG_OUTPUT |
| 24 | + #define DBG_PORT_WG WIFI_GENERIC_DEBUG_OUTPUT |
24 | 25 | #else
|
25 |
| - #define DBG_PORT_RT8720 Serial |
| 26 | + #define DBG_PORT_WG Serial |
26 | 27 | #endif
|
27 | 28 |
|
28 |
| -// Change _WM_LOGLEVEL_ to set tracing and logging verbosity |
| 29 | +// Change _WIFI_GENERIC_LOGLEVEL_ to set tracing and logging verbosity |
29 | 30 | // 0: DISABLED: no logging
|
30 | 31 | // 1: ERROR: errors
|
31 | 32 | // 2: WARN: errors and warnings
|
32 | 33 | // 3: INFO: errors, warnings and informational (default)
|
33 | 34 | // 4: DEBUG: errors, warnings, informational and debug
|
34 | 35 |
|
35 |
| -#ifndef _WM_LOGLEVEL_ |
36 |
| - #define _WM_LOGLEVEL_ 0 |
| 36 | +#ifndef _WIFI_GENERIC_LOGLEVEL_ |
| 37 | + #define _WIFI_GENERIC_LOGLEVEL_ 0 |
37 | 38 | #endif
|
38 | 39 |
|
39 |
| -const char RT8720_MARK[] = "[WML] "; |
| 40 | +//////////////////////////////////////////////////////////////////////////////////////////// |
| 41 | + |
| 42 | +const char WG_MARK[] = "[WG] "; |
40 | 43 |
|
41 |
| -#define RT8720_PRINT_MARK DBG_PORT_RT8720.print(RT8720_MARK) |
| 44 | +#define WG_PRINT_MARK DBG_PORT_WG.print(WG_MARK) |
42 | 45 |
|
43 |
| -#define RT8720_PRINT DBG_PORT_RT8720.print |
44 |
| -#define RT8720_PRINTLN DBG_PORT_RT8720.println |
| 46 | +#define WG_PRINT DBG_PORT_WG.print |
| 47 | +#define WG_PRINTLN DBG_PORT_WG.println |
45 | 48 |
|
| 49 | +// Error waitResponse message |
| 50 | +#define ERROR_RESPONSE ":Error waitResponse" |
46 | 51 |
|
47 |
| -/////////////////////////////////////////// |
| 52 | +//////////////////////////////////////////////////////////////////////////////////////////// |
48 | 53 |
|
49 |
| -#define WM_LOGERROR0(x) if(_WM_LOGLEVEL_>0) { RT8720_PRINT(x); } |
50 |
| -#define WM_LOGERROR(x) if(_WM_LOGLEVEL_>0) { RT8720_PRINT_MARK; RT8720_PRINTLN(x); } |
51 |
| -#define WM_LOGERROR1(x,y) if(_WM_LOGLEVEL_>0) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINTLN(y); } |
52 |
| -#define WM_LOGERROR2(x,y,z) if(_WM_LOGLEVEL_>0) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINTLN(z); } |
53 |
| -#define WM_LOGERROR3(x,y,z,w) if(_WM_LOGLEVEL_>0) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINTLN(w); } |
54 |
| -#define WM_LOGERROR5(x,y,z,w,xx,yy) if(_WM_LOGLEVEL_>0) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINT(w); RT8720_PRINT(xx); RT8720_PRINTLN(yy); } |
| 54 | +#define WG_LOGERROR0(x) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT(x); } |
| 55 | +#define WG_LOGERROR(x) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT_MARK; WG_PRINTLN(x); } |
| 56 | +#define WG_LOGERROR1(x,y) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINTLN(y); } |
| 57 | +#define WG_LOGERROR2(x,y,z) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINTLN(z); } |
| 58 | +#define WG_LOGERROR3(x,y,z,w) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINTLN(w); } |
| 59 | +#define WG_LOGERROR5(x,y,z,w,xx,yy) if(_WIFI_GENERIC_LOGLEVEL_>0) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINT(w); WG_PRINT(xx); WG_PRINTLN(yy); } |
55 | 60 |
|
56 |
| -/////////////////////////////////////////// |
| 61 | +//////////////////////////////////////////////////////////////////////////////////////////// |
57 | 62 |
|
58 |
| -#define WM_LOGWARN0(x) if(_WM_LOGLEVEL_>1) { RT8720_PRINT(x); } |
59 |
| -#define WM_LOGWARN(x) if(_WM_LOGLEVEL_>1) { RT8720_PRINT_MARK; RT8720_PRINTLN(x); } |
60 |
| -#define WM_LOGWARN1(x,y) if(_WM_LOGLEVEL_>1) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINTLN(y); } |
61 |
| -#define WM_LOGWARN2(x,y,z) if(_WM_LOGLEVEL_>1) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINTLN(z); } |
62 |
| -#define WM_LOGWARN3(x,y,z,w) if(_WM_LOGLEVEL_>1) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINTLN(w); } |
63 |
| -#define WM_LOGWARN5(x,y,z,w,xx,yy) if(_WM_LOGLEVEL_>1) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINT(w); RT8720_PRINT(xx); RT8720_PRINTLN(yy); } |
| 63 | +#define WG_LOGWARN0(x) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT(x); } |
| 64 | +#define WG_LOGWARN(x) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT_MARK; WG_PRINTLN(x); } |
| 65 | +#define WG_LOGWARN1(x,y) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINTLN(y); } |
| 66 | +#define WG_LOGWARN2(x,y,z) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINTLN(z); } |
| 67 | +#define WG_LOGWARN3(x,y,z,w) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINTLN(w); } |
| 68 | +#define WG_LOGWARN5(x,y,z,w,xx,yy) if(_WIFI_GENERIC_LOGLEVEL_>1) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINT(w); WG_PRINT(xx); WG_PRINTLN(yy); } |
64 | 69 |
|
65 |
| -/////////////////////////////////////////// |
| 70 | +//////////////////////////////////////////////////////////////////////////////////////////// |
66 | 71 |
|
67 |
| -#define WM_LOGINFO0(x) if(_WM_LOGLEVEL_>2) { RT8720_PRINT(x); } |
68 |
| -#define WM_LOGINFO(x) if(_WM_LOGLEVEL_>2) { RT8720_PRINT_MARK; RT8720_PRINTLN(x); } |
69 |
| -#define WM_LOGINFO1(x,y) if(_WM_LOGLEVEL_>2) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINTLN(y); } |
70 |
| -#define WM_LOGINFO2(x,y,z) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINTLN(z); } |
71 |
| -#define WM_LOGINFO3(x,y,z,w) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINTLN(w); } |
72 |
| -#define WM_LOGINFO5(x,y,z,w,xx,yy) if(_WM_LOGLEVEL_>2) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINT(w); RT8720_PRINT(xx); RT8720_PRINTLN(yy); } |
| 72 | +#define WG_LOGINFO0(x) if(_WIFI_GENERIC_LOGLEVEL_>2) { WG_PRINT(x); } |
| 73 | +#define WG_LOGINFO(x) if(_WIFI_GENERIC_LOGLEVEL_>2) { WG_PRINT_MARK; WG_PRINTLN(x); } |
| 74 | +#define WG_LOGINFO1(x,y) if(_WIFI_GENERIC_LOGLEVEL_>2) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINTLN(y); } |
| 75 | +#define WG_LOGINFO2(x,y,z) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINTLN(z); } |
| 76 | +#define WG_LOGINFO3(x,y,z,w) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINTLN(w); } |
| 77 | +#define WG_LOGINFO5(x,y,z,w,xx,yy) if(_WIFI_GENERIC_LOGLEVEL_>2) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINT(w); WG_PRINT(xx); WG_PRINTLN(yy); } |
73 | 78 |
|
74 |
| -/////////////////////////////////////////// |
| 79 | +//////////////////////////////////////////////////////////////////////////////////////////// |
75 | 80 |
|
76 |
| -#define WM_LOGDEBUG0(x) if(_WM_LOGLEVEL_>3) { RT8720_PRINT(x); } |
77 |
| -#define WM_LOGDEBUG(x) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINTLN(x); } |
78 |
| -#define WM_LOGDEBUG1(x,y) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINTLN(y); } |
79 |
| -#define WM_LOGDEBUG2(x,y,z) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINTLN(z); } |
80 |
| -#define WM_LOGDEBUG3(x,y,z,w) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINTLN(w); } |
81 |
| -#define WM_LOGDEBUG5(x,y,z,w,xx,yy) if(_WM_LOGLEVEL_>3) { RT8720_PRINT_MARK; RT8720_PRINT(x); RT8720_PRINT(y); RT8720_PRINT(z); RT8720_PRINT(w); RT8720_PRINT(xx); RT8720_PRINTLN(yy); } |
| 81 | +#define WG_LOGDEBUG0(x) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT(x); } |
| 82 | +#define WG_LOGDEBUG(x) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINTLN(x); } |
| 83 | +#define WG_LOGDEBUG1(x,y) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINTLN(y); } |
| 84 | +#define WG_LOGDEBUG2(x,y,z) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINTLN(z); } |
| 85 | +#define WG_LOGDEBUG3(x,y,z,w) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINTLN(w); } |
| 86 | +#define WG_LOGDEBUG5(x,y,z,w,xx,yy) if(_WIFI_GENERIC_LOGLEVEL_>3) { WG_PRINT_MARK; WG_PRINT(x); WG_PRINT(y); WG_PRINT(z); WG_PRINT(w); WG_PRINT(xx); WG_PRINTLN(yy); } |
82 | 87 |
|
83 |
| -/////////////////////////////////////////// |
| 88 | +//////////////////////////////////////////////////////////////////////////////////////////// |
84 | 89 |
|
85 |
| -#endif //WiFiManager_RT8720_Debug_h |
| 90 | +#endif //WiFiManager_RTL8720_Debug_h |
0 commit comments