This repository has been archived by the owner on Feb 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dynamicParams.h
83 lines (59 loc) · 2.76 KB
/
dynamicParams.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
/****************************************************************************************************************************
dynamicParams.h
For ESP32 TTGO-TCALL boards to run GSM/GPRS and WiFi simultaneously, using config portal feature
Uploading SHT3x temperature and humidity data to Blynk
Library to enable GSM/GPRS and WiFi running simultaneously , with WiFi config portal.
Based on and modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases
Built by Khoi Hoang https://github.com/khoih-prog/BlynkGSM_Manager
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef dynamicParams_h
#define dynamicParams_h
#if USE_BLYNK_WM
#if (USE_DYNAMIC_PARAMETERS)
#warning USE_DYNAMIC_PARAMETERS
#endif
// USE_DYNAMIC_PARAMETERS defined in defined.h
/////////////// Start dynamic Credentials ///////////////
//Defined in <BlynkSimpleEsp32_GSM_WFM.h>
/**************************************
#define MAX_ID_LEN 5
#define MAX_DISPLAY_NAME_LEN 16
typedef struct
{
char id [MAX_ID_LEN + 1];
char displayName [MAX_DISPLAY_NAME_LEN + 1];
char *pdata;
uint8_t maxlen;
} MenuItem;
**************************************/
#if USE_DYNAMIC_PARAMETERS
#define MAX_MQTT_SERVER_LEN 34
char MQTT_Server [MAX_MQTT_SERVER_LEN + 1] = "mqtt.ddns.net";
#define MAX_MQTT_PORT_LEN 6
char MQTT_Port [MAX_MQTT_PORT_LEN + 1] = "1883";
#define MAX_MQTT_USERNAME_LEN 34
char MQTT_UserName [MAX_MQTT_USERNAME_LEN + 1] = "mqtt-user";
#define MAX_MQTT_PW_LEN 34
char MQTT_PW [MAX_MQTT_PW_LEN + 1] = "mqtt-pass";
#define MAX_MQTT_SUBS_TOPIC_LEN 34
char MQTT_SubsTopic [MAX_MQTT_SUBS_TOPIC_LEN + 1] = "SubTopic_ESP32_GSM";
#define MAX_MQTT_PUB_TOPIC_LEN 34
char MQTT_PubTopic [MAX_MQTT_PUB_TOPIC_LEN + 1] = "PubTopic_ESP32_GSM";
MenuItem myMenuItems [] =
{
{ "mqtt", "MQTT Server", MQTT_Server, MAX_MQTT_SERVER_LEN },
{ "mqpt", "Port", MQTT_Port, MAX_MQTT_PORT_LEN },
{ "user", "MQTT UserName", MQTT_UserName, MAX_MQTT_USERNAME_LEN },
{ "mqpw", "MQTT PWD", MQTT_PW, MAX_MQTT_PW_LEN },
{ "subs", "Subs Topics", MQTT_SubsTopic, MAX_MQTT_SUBS_TOPIC_LEN },
{ "pubs", "Pubs Topics", MQTT_PubTopic, MAX_MQTT_PUB_TOPIC_LEN },
};
uint16_t NUM_MENU_ITEMS = sizeof(myMenuItems) / sizeof(MenuItem); //MenuItemSize;
#else
MenuItem myMenuItems [] = {};
uint16_t NUM_MENU_ITEMS = 0;
#endif
/////// // End dynamic Credentials ///////////
#endif // #if USE_BLYNK_WM
#endif //dynamicParams_h