AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_config.h
Go to the documentation of this file.
1/*******************************************************************************
2* Copyright (c) 2021, Buildstorm Pvt Ltd
3*
4* Filename: lib_config.h
5*
6* Author: Amruta
7* email: amruta@buildstorm.com
8*
9* Description:
10* Contains macros for the application
11*******************************************************************************/
12
18#ifndef _LIB_CONFIG_H_
19#define _LIB_CONFIG_H_
20
21#include "esp_types.h"
22#include "stdutils.h"
23
24#define LIB_VERSION "1.0.0"
25
26//---------------------------Debug CONFIG---------------------------/
27
32typedef enum
33{
41
42#define LOG_LEVEL_MAPPING \
43 { \
44 'n', 'e', 'i', 'd' \
45 }
46#define GLOBAL_LOG_LEVEL PRINT_LEVEL_ERROR
47#define LOG_PASS_CODE_STR "[12345678]" // TODO: expose to user ????
48
53typedef enum
54{
55 LIB_MODULE_MAIN_MENU,
56 LIB_MODULE_SYSTEM,
57 LIB_MODULE_BLE,
58 LIB_MODULE_WIFI,
59 LIB_MODULE_MQTT,
60 LIB_MODULE_AWS,
61 LIB_MODULE_JOBS,
62 LIB_MODULE_GPIO,
63 LIB_MODULE_FLASH,
64 DRV_MODULE_BLE,
65 LIB_MODULE_JSON,
66 LIB_MODULE_HTTP,
67 LIB_MODULE_OTA,
68 LIB_MODULE_MAX
70
71//---------------------------WIFI CONFIG------------------------------/
72#define TIME_WIFI_NEXT_SCAN 2000 // in milli seconds
73#define TIME_WIFI_SCAN_END 4000 // in milli seconds
74
75#define TIMEOUT_WIFI_RECONNECT 10000 // in milli seconds
76#define TIMEOUT_WIFI_RESTART 30000 // in milli seconds
77
78#define LENGTH_WIFI_CRED_SSID 32
79#define LENGTH_WIFI_CRED_PASSWORD 64
80#define LENGTH_MAC_ADDRESS 13
81#define LENGTH_IP_ADDRESS 16 // "192.168.192.168"
82
83//--------------------------DEVICE CONFIG--------------------------------/
84#define LENGTH_CHIP_ID LENGTH_MAC_ADDRESS
85#define LENGTH_DEVICE_NAME 32
86#define LENGTH_PRODUCT_ID LENGTH_DEVICE_NAME
87
88#define TIME_MILLIS_ROLLOVER 0xFF000000 // in milli seconds (max millis
89
90//--------------------------HTTP CONFIG--------------------------------/
91#define LENGTH_HTTP_URL 150
92#define LENGTH_HTTP_PACKET 1024
93#define HTTP_RING_BUFFER_SIZE 4
94
95//--------------------------MQTT CONFIG--------------------------------/
96#define MQTT_TOPIC_OTA_STR "topicOTA/ESP32"
97
98#define LENGTH_MQTT_TOPIC 100
99#define LENGTH_MQTT_PAYLOAD 1024
100#define MQTT_MAX_SUBSCRIBE_TOPICS 4
101
102#define LENGTH_MQTT_URI LENGTH_HTTP_URL
103#define LENGTH_MQTT_USERNAME 32
104#define LENGTH_MQTT_PASSWORD 32
105
106#define MQTT_PUB_RING_BUFFER_SIZE 5
107#define MQTT_SUB_RING_BUFFER_SIZE 3
108
109//------------------------AWS Config-----------------------------------/
110#define LENGTH_AWS_TOPIC LENGTH_MQTT_TOPIC
111#define LENGTH_AWS_PAYLOAD LENGTH_MQTT_PAYLOAD
112#define AWS_MAX_SUBSCRIBE_TOPICS 3
113#define AWS_MAX_PUBLISH_RETRY 3
114
115#define AWS_PUB_RING_BUFFER_SIZE 3
116#define AWS_SUB_RING_BUFFER_SIZE 3
117
118#define LENGTH_AWS_JOB_ACTION 32
119#define AWS_MAX_JOBS 3
120
121#define AWS_MAX_SHADOWS_ELEMETS 5
122#define LENGTH_AWS_SHADOW_KEY 16
123#define LENGTH_AWS_SHADOW_BUFFER 32
124
125#define LENGTH_THING_NAME LENGTH_DEVICE_NAME
126
127#define LENGTH_ROOT_CA_MAX 1300u
128#define LENGTH_CERTIFICATE_MAX 1400u
129#define LENGTH_PRIVATE_KEY_MAX 1800u
130
131//--------------------------BLE CONFIG--------------------------------/
132#define BLE_PAYLOAD_SIZE 256
133
134#define TIMEOUT_BLE_AUTH 30000
135#define TIMEOUT_BLE_RX 5000
136
137#define BLE_TX_RING_BUFFER_SIZE 3
138#define BLE_RX_RING_BUFFER_SIZE 3
139
140//-------------------------TASK CONFIG--------------------------/
141#define TASK_SYSTEM_PRIORITY 5
142#define TASK_SYSTEM_STACK_SIZE (6 * 1024) // reduce it to 4096
143
144#define TASK_MQTT_PRIORITY 6
145#define TASK_MQTT_STACK_SIZE (6 * 1024) // reduce it to 4096
146
147//------------------------FLASH CONFIG--------------------------------/
148#define FLASH_APP_DATA_SIZE 256
149
150//------------------------OTA CONFIG--------------------------------/
151#define LENGTH_OTA_URL LENGTH_HTTP_URL
152
153#endif
logLevels_et
Levels of debug messages for printing.
Definition: lib_config.h:33
@ PRINT_LEVEL_NONE
Definition: lib_config.h:34
@ PRINT_LEVEL_DEBUG
Definition: lib_config.h:38
@ PRINT_LEVEL_VERBOSE
Definition: lib_config.h:36
@ PRINT_LEVEL_MAX
Definition: lib_config.h:39
@ PRINT_LEVEL_ERROR
Definition: lib_config.h:35
@ PRINT_LEVEL_INFO
Definition: lib_config.h:37
menusLibModule_et
An enum to represent Library modules.
Definition: lib_config.h:54