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 10
/
Copy pathdynamicParams.h
76 lines (55 loc) · 2.62 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
/****************************************************************************************************************************
dynamicParams.h for Teensy40_WiFiNINA_MQTT.ino
For Teensy boards using WiFiNINA modules/shields, using much less code to support boards with smaller memory
WiFiManager_NINA_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards
(https://github.com/khoih-prog/WiFiManager_NINA_Lite) to enable store Credentials in EEPROM/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_NINA_Lite
Licensed under MIT license
*****************************************************************************************************************************/
#ifndef dynamicParams_h
#define dynamicParams_h
#include "defines.h"
// USE_DYNAMIC_PARAMETERS defined in defined.h
/////////////// Start dynamic Credentials ///////////////
//Defined in <WiFiManager_NINA_Lite_Teensy.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 AIO_SERVER_LEN 20
#define AIO_SERVERPORT_LEN 6
#define AIO_USERNAME_LEN 20
#define AIO_KEY_LEN 40
//
#define AIO_PUB_TOPIC_LEN 40
#define AIO_SUB_TOPIC_LEN 40
char AIO_SERVER [AIO_SERVER_LEN + 1] = "io.adafruit.com";
char AIO_SERVERPORT [AIO_SERVERPORT_LEN + 1] = "1883"; //1883, or 8883 for SSL
char AIO_USERNAME [AIO_USERNAME_LEN + 1] = "private";
char AIO_KEY [AIO_KEY_LEN + 1] = "private";
char AIO_PUB_TOPIC [AIO_PUB_TOPIC_LEN + 1] = "/feeds/Temperature";
char AIO_SUB_TOPIC [AIO_SUB_TOPIC_LEN + 1] = "/feeds/LED_Control";
MenuItem myMenuItems [] =
{
{ "svr", "AIO_SERVER", AIO_SERVER, AIO_SERVER_LEN },
{ "prt", "AIO_SERVERPORT", AIO_SERVERPORT, AIO_SERVERPORT_LEN },
{ "usr", "AIO_USERNAME", AIO_USERNAME, AIO_USERNAME_LEN },
{ "key", "AIO_KEY", AIO_KEY, AIO_KEY_LEN },
{ "pub", "AIO_PUB_TOPIC", AIO_PUB_TOPIC, AIO_PUB_TOPIC_LEN },
{ "sub", "AIO_SUB_TOPIC", AIO_SUB_TOPIC, AIO_SUB_TOPIC_LEN },
};
uint16_t NUM_MENU_ITEMS = sizeof(myMenuItems) / sizeof(MenuItem); //MenuItemSize;
#else
MenuItem myMenuItems [] = {};
uint16_t NUM_MENU_ITEMS = 0;
#endif //USE_DYNAMIC_PARAMETERS
#endif //dynamicParams_h