]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/mqtt/iot_config.h
Cosmetic changes in the MQTT demo - mostly comment updates.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_IoT_Libraries / mqtt / iot_config.h
1 /*\r
2  * Copyright (C) 2018 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 \r
28 /**\r
29  * @brief The number of recyclable jobs for the task pool to cache.\r
30  *\r
31  * Caching dynamically allocated jobs (recyclable jobs) helps the application\r
32  * to limit the number of allocations at runtime. Caching recyclable jobs may\r
33  * help making the application more responsive and predictable, by removing a\r
34  * potential for memory allocation failures, but it may also have negative\r
35  * repercussions on the amount of memory available at any given time. It is up\r
36  * to the application developer to strike the correct balance among these\r
37  * competing needs. The task pool will cache a job when the application calls\r
38  * IotTaskPool_RecycleJob on a job which was created using\r
39  * IotTaskPool_CreateRecyclableJob API. Any recycled jobs in excess of\r
40  * IOT_TASKPOOL_JOBS_RECYCLE_LIMIT will be destroyed and its memory will be\r
41  * released.\r
42  *\r
43  * Default value (if undefined): 8\r
44  */\r
45 #define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT             8\r
46 \r
47 /**\r
48  * @brief Enable/Disable asserts for the task pool library.\r
49  *\r
50  * Set this to 1 to perform sanity checks when using the task pool library.\r
51  * Asserts are useful for debugging, but should be disabled in production code.\r
52  * If this is set to 1, IotTaskPool_Assert can be defined to set the assertion\r
53  * function; otherwise, the standard library's assert function will be used.\r
54  *\r
55  * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
56  * Recommended values: 1 when debugging; 0 in production code.\r
57  * Default value (if undefined): 0\r
58  */\r
59 #define IOT_TASKPOOL_ENABLE_ASSERTS                 1\r
60 \r
61 /**\r
62  * @brief The numer of worker tasks in the task pool.\r
63  *\r
64  * The full IoT Task Pool Library has many use cases, including Linux\r
65  * development. Typical FreeRTOS use cases do not require the full\r
66  * functionality so an optimized implementation is provided specifically for use\r
67  * with FreeRTOS. The optimized version has a fixed number of tasks in the\r
68  * task pool, each of which uses statically allocated memory to ensure creation\r
69  * of the task pool is guaranteed (it does not run out of heap space).\r
70  */\r
71 #define IOT_TASKPOOL_NUMBER_OF_WORKERS               3\r
72 \r
73 /*\r
74  * @brief Set the log level of the task pool library.\r
75  *\r
76  * Log messages from the task pool library at or below this setting will be\r
77  * printed.\r
78  *\r
79  * Possible values: One of the Log levels.\r
80  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
81  * then IOT_LOG_NONE.\r
82  */\r
83 #define IOT_LOG_LEVEL_TASKPOOL                      IOT_LOG_WARN\r
84 \r
85 \r
86 /**\r
87  * @brief The stack size (in bytes) for each worker task in the task pool.\r
88  *\r
89  * The minimal version of the of task pool library only supports one task pool\r
90  * and the configuration of each worker task fixed at the compile time.\r
91  */\r
92 #define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES        2048\r
93 \r
94 /**\r
95  * @brief The amount of time the MQTT library waits for responses (PINGRESPs or\r
96  * PUBACKs) from the MQTT broker.\r
97  */\r
98 #define IOT_MQTT_RESPONSE_WAIT_MS                   ( 10000 )\r
99 \r
100 /**\r
101  * @brief Enable/Disable anonymous metrics collection when using AWS IoT.\r
102  *\r
103  * This demo does not use TLS and so does not work with AWS IoT. Therefore,\r
104  * the metric collection must be disabled.\r
105  */\r
106 #define AWS_IOT_MQTT_ENABLE_METRICS                 0\r
107 \r
108 /**\r
109  * @brief Set the log level of the MQTT library.\r
110  *\r
111  * Log messages from the MQTT library at or below this setting will be printed.\r
112  *\r
113  * Possible values: One of the Log levels.\r
114  * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
115  * then IOT_LOG_NONE.\r
116  */\r
117 #define IOT_LOG_LEVEL_MQTT                          IOT_LOG_WARN\r
118 \r
119 /* Include the common configuration file for FreeRTOS. */\r
120 #include "iot_config_common.h"\r
121 \r
122 #endif /* ifndef IOT_CONFIG_H_ */\r