]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/mqtt_tls_mutual_auth/iot_config.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_IoT_Libraries / mqtt / mqtt_tls_mutual_auth / iot_config.h
1 /*\r
2  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
3  *\r
4  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
5  * this software and associated documentation files (the "Software"), to deal in\r
6  * the Software without restriction, including without limitation the rights to\r
7  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
8  * the Software, and to permit persons to whom the Software is furnished to do so,\r
9  * subject to the following conditions:\r
10  *\r
11  * The above copyright notice and this permission notice shall be included in all\r
12  * copies or substantial portions of the Software.\r
13  *\r
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
16  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
17  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
18  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
19  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
20  */\r
21 \r
22 /* This file contains configuration settings for the demos. */\r
23 \r
24 #ifndef IOT_CONFIG_H_\r
25 #define IOT_CONFIG_H_\r
26 \r
27 /* Configure the IoT Libraries for FreeRTOS by including the FreeRTOS header and\r
28  * the FreeRTOS platform types. */\r
29 #include "FreeRTOS.h"\r
30 #include "platform/iot_platform_types_freertos.h"\r
31 \r
32 /**\r
33  * @brief Set a global default for log levels.\r
34  *\r
35  * This setting is overridden by log level settings of specific libraries.\r
36  * Undefined library-specific log levels will default to this value.\r
37  *\r
38  * Possible values: One of the Log levels.\r
39  * Default value (if undefined): IOT_LOG_NONE.\r
40  */\r
41 #define IOT_LOG_LEVEL_GLOBAL                    IOT_LOG_NONE\r
42 \r
43 /**\r
44  * @brief Set the log level of the platform libraries except the network\r
45  * component.\r
46  *\r
47  * Log messages from the platform libraries at or below this setting\r
48  * will be printed. As the network component is more verbose, its logging\r
49  * is controlled by its own setting, IOT_LOG_LEVEL_NETWORK.\r
50  *\r
51  * Possible values: One of the Log levels.\r
52  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
53  * then IOT_LOG_NONE.\r
54  */\r
55 #define IOT_LOG_LEVEL_PLATFORM                  IOT_LOG_NONE\r
56 \r
57 /**\r
58  * @brief Set the log level of the platform network library.\r
59  *\r
60  * Log messages from the platform network library at or below this setting\r
61  * will be printed.\r
62  *\r
63  * Possible values: One of the Log levels.\r
64  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
65  * then IOT_LOG_NONE.\r
66  */\r
67 #define IOT_LOG_LEVEL_NETWORK                   IOT_LOG_WARN\r
68 \r
69 /*\r
70  * @brief Set the log level of the task pool library.\r
71  *\r
72  * Log messages from the task pool library at or below this setting will be\r
73  * printed.\r
74  *\r
75  * Possible values: One of the Log levels.\r
76  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
77  * then IOT_LOG_NONE.\r
78  */\r
79 #define IOT_LOG_LEVEL_TASKPOOL                  IOT_LOG_WARN\r
80 \r
81 /**\r
82  * @brief Set the log level of the MQTT library.\r
83  *\r
84  * Log messages from the MQTT library at or below this setting will be printed.\r
85  *\r
86  * Possible values: One of the Log levels.\r
87  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
88  * then IOT_LOG_NONE.\r
89  */\r
90 #define IOT_LOG_LEVEL_MQTT                      IOT_LOG_WARN\r
91 \r
92 /**\r
93  * @brief Enable/Disable asserts for the task pool library.\r
94  *\r
95  * Set this to 1 to perform sanity checks when using the task pool library.\r
96  * Asserts are useful for debugging, but should be disabled in production code.\r
97  * If this is set to 1, IotTaskPool_Assert can be defined to set the assertion\r
98  * function; otherwise, the standard library's assert function will be used.\r
99  *\r
100  * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
101  * Recommended values: 1 when debugging; 0 in production code.\r
102  * Default value (if undefined): 0\r
103  */\r
104 #define IOT_TASKPOOL_ENABLE_ASSERTS             1\r
105 \r
106 /**\r
107  * @brief The numer of worker tasks in the task pool.\r
108  *\r
109  * The full IoT Task Pool Library has many use cases, including Linux\r
110  * development. Typical FreeRTOS use cases do not require the full\r
111  * functionality so an optimized implementation is provided specifically for use\r
112  * with FreeRTOS. The optimized version has a fixed number of tasks in the\r
113  * task pool, each of which uses statically allocated memory to ensure creation\r
114  * of the task pool is guaranteed (it does not run out of heap space).\r
115  */\r
116 #define IOT_TASKPOOL_NUMBER_OF_WORKERS          1\r
117 \r
118 /**\r
119  * @brief The stack size (in bytes) for each worker task in the task pool.\r
120  *\r
121  * The minimal version of the of task pool library only supports one task pool\r
122  * and the configuration of each worker task fixed at the compile time.\r
123  */\r
124 #define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES    2048\r
125 \r
126 /**\r
127  * @brief Enable TLS in the network abstraction.\r
128  *\r
129  * The TLS implementation requires the mbed TLS library.\r
130  */\r
131 #define IOT_NETWORK_ENABLE_TLS                  1\r
132 \r
133 /**\r
134  * @brief Enable/Disable asserts for the linear containers library.\r
135  *\r
136  * Set this to 1 to perform sanity checks when using the linear containers library.\r
137  * Asserts are useful for debugging, but should be disabled in production code.\r
138  * If this is set to 1, IotContainers_Assert can be defined to set the assertion\r
139  * function; otherwise, the standard library's assert function will be used.\r
140  *\r
141  * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
142  * Recommended values: 1 when debugging; 0 in production code.\r
143  * Default value (if undefined): 0\r
144  */\r
145 #define IOT_CONTAINERS_ENABLE_ASSERTS           1\r
146 \r
147 /**\r
148  * @brief Enable/Disable asserts for the MQTT library.\r
149  *\r
150  * Set this to 1 to perform sanity checks when using the MQTT library.\r
151  * Asserts are useful for debugging, but should be disabled in production code.\r
152  * If this is set to 1, IotMqtt_Assert can be defined to set the assertion\r
153  * function; otherwise, the standard library's assert function will be used.\r
154  *\r
155  * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
156  * Recommended values: 1 when debugging; 0 in production code.\r
157  * Default value (if undefined): 0\r
158  */\r
159 #define IOT_MQTT_ENABLE_ASSERTS                 1\r
160 \r
161 /**\r
162  * @brief Enable/Disable anonymous metrics collection when using AWS IoT.\r
163  */\r
164 #define AWS_IOT_MQTT_ENABLE_METRICS             0\r
165 \r
166 /* Common settings for FreeRTOS; settings below this line generally do not need\r
167  * to be changed. */\r
168 \r
169 /* Logging puts function on FreeRTOS. */\r
170 #define IotLogging_Puts( str )    configPRINTF( ( "%s\r\n", str ) )\r
171 \r
172 /* Assert functions on FreeRTOS. */\r
173 #define Iot_DefaultAssert    configASSERT\r
174 \r
175 /* Memory allocation functions on FreeRTOS. */\r
176 #define Iot_DefaultMalloc    pvPortMalloc\r
177 #define Iot_DefaultFree      vPortFree\r
178 \r
179 #endif /* ifndef IOT_CONFIG_H_ */\r