This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Credentials.h
93 lines (65 loc) · 2.73 KB
/
Credentials.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/****************************************************************************************************************************
Credentials.h
For RTL8720DN, RTL8722DM, RTL8722CSM, etc. boards
WiFiManager_RTL8720 (https://github.com/khoih-prog/WiFiManager_RTL8720) is a library
for the RTL8720DN, RTL8722DM, RTL8722CSM, etc. boards to enable store Credentials in FlashStorage/SPIFFS/LittleFS for easy
configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_RTL8720
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef Credentials_h
#define Credentials_h
#include "defines.h"
/// Start Default Config Data //////////////////
/*
#define SSID_MAX_LEN 32
//From v1.0.3, WPA2 passwords can be up to 63 characters long.
#define PASS_MAX_LEN 64
typedef struct
{
char wifi_ssid[SSID_MAX_LEN];
char wifi_pw [PASS_MAX_LEN];
} WiFi_Credentials;
#define NUM_WIFI_CREDENTIALS 2
// Configurable items besides fixed Header, just add board_name
#define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ) + 1 )
////////////////
typedef struct Configuration
{
char header [16];
WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS];
char board_name [24];
int checkSum;
} ESP_WM_LITE_Configuration;
*/
#define TO_LOAD_DEFAULT_CONFIG_DATA false
#if TO_LOAD_DEFAULT_CONFIG_DATA
// This feature is primarily used in development to force a known set of values as Config Data
// It will NOT force the Config Portal to activate. Use DRD or erase Config Data with ESP_WiFiManager.clearConfigData()
// Used mostly for development and debugging. FORCES default values to be loaded each run.
// Config Portal data input will be ignored and overridden by DEFAULT_CONFIG_DATA
//bool LOAD_DEFAULT_CONFIG_DATA = true;
// Used mostly once debugged. Assumes good data already saved in device.
// Config Portal data input will be override DEFAULT_CONFIG_DATA
bool LOAD_DEFAULT_CONFIG_DATA = false;
WM_Configuration defaultConfig =
{
//char header[16], dummy, not used
"RTL8720",
// WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS];
// WiFi_Credentials.wifi_ssid and WiFi_Credentials.wifi_pw
"SSID1", "password1",
"SSID2", "password2",
//char board_name [24];
"RTL8720-Control",
// terminate the list
//int checkSum, dummy, not used
0
/////////// End Default Config Data /////////////
};
#else
bool LOAD_DEFAULT_CONFIG_DATA = false;
WM_Configuration defaultConfig;
#endif // TO_LOAD_DEFAULT_CONFIG_DATA
/////////// End Default Config Data /////////////
#endif //Credentials_h