]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/mqtt_plain_text/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_plain_text / iot_config.h
diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/mqtt_plain_text/iot_config.h b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/mqtt_plain_text/iot_config.h
new file mode 100644 (file)
index 0000000..bcb8b87
--- /dev/null
@@ -0,0 +1,175 @@
+/*\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/* This file contains configuration settings for the demos. */\r
+\r
+#ifndef IOT_CONFIG_H_\r
+#define IOT_CONFIG_H_\r
+\r
+/* Configure the IoT Libraries for FreeRTOS by including the FreeRTOS header and\r
+ * the FreeRTOS platform types. */\r
+#include "FreeRTOS.h"\r
+#include "platform/iot_platform_types_freertos.h"\r
+\r
+/**\r
+ * @brief Set a global default for log levels.\r
+ *\r
+ * This setting is overridden by log level settings of specific libraries.\r
+ * Undefined library-specific log levels will default to this value.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_GLOBAL                    IOT_LOG_NONE\r
+\r
+/**\r
+ * @brief Set the log level of the platform libraries except the network\r
+ * component.\r
+ *\r
+ * Log messages from the platform libraries at or below this setting\r
+ * will be printed. As the network component is more verbose, its logging\r
+ * is controlled by its own setting, IOT_LOG_LEVEL_NETWORK.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
+ * then IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_PLATFORM                  IOT_LOG_NONE\r
+\r
+/**\r
+ * @brief Set the log level of the platform network library.\r
+ *\r
+ * Log messages from the platform network library at or below this setting\r
+ * will be printed.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
+ * then IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_NETWORK                   IOT_LOG_WARN\r
+\r
+/*\r
+ * @brief Set the log level of the task pool library.\r
+ *\r
+ * Log messages from the task pool library at or below this setting will be\r
+ * printed.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
+ * then IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_TASKPOOL                  IOT_LOG_WARN\r
+\r
+/**\r
+ * @brief Set the log level of the MQTT library.\r
+ *\r
+ * Log messages from the MQTT library at or below this setting will be printed.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
+ * then IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_MQTT                      IOT_LOG_WARN\r
+\r
+/**\r
+ * @brief Enable/Disable asserts for the task pool library.\r
+ *\r
+ * Set this to 1 to perform sanity checks when using the task pool library.\r
+ * Asserts are useful for debugging, but should be disabled in production code.\r
+ * If this is set to 1, IotTaskPool_Assert can be defined to set the assertion\r
+ * function; otherwise, the standard library's assert function will be used.\r
+ *\r
+ * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
+ * Recommended values: 1 when debugging; 0 in production code.\r
+ * Default value (if undefined): 0\r
+ */\r
+#define IOT_TASKPOOL_ENABLE_ASSERTS             1\r
+\r
+/**\r
+ * @brief The number of worker tasks in the task pool.\r
+ *\r
+ * The full IoT Task Pool Library has many use cases, including Linux\r
+ * development. Typical FreeRTOS use cases do not require the full\r
+ * functionality so an optimized implementation is provided specifically for use\r
+ * with FreeRTOS. The optimized version has a fixed number of tasks in the\r
+ * task pool, each of which uses statically allocated memory to ensure creation\r
+ * of the task pool is guaranteed (it does not run out of heap space).\r
+ */\r
+#define IOT_TASKPOOL_NUMBER_OF_WORKERS          1\r
+\r
+/**\r
+ * @brief The stack size (in bytes) for each worker task in the task pool.\r
+ *\r
+ * The minimal version of the of task pool library only supports one task pool\r
+ * and the configuration of each worker task fixed at the compile time.\r
+ */\r
+#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES    2048\r
+\r
+/**\r
+ * @brief Enable/Disable asserts for the linear containers library.\r
+ *\r
+ * Set this to 1 to perform sanity checks when using the linear containers library.\r
+ * Asserts are useful for debugging, but should be disabled in production code.\r
+ * If this is set to 1, IotContainers_Assert can be defined to set the assertion\r
+ * function; otherwise, the standard library's assert function will be used.\r
+ *\r
+ * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
+ * Recommended values: 1 when debugging; 0 in production code.\r
+ * Default value (if undefined): 0\r
+ */\r
+#define IOT_CONTAINERS_ENABLE_ASSERTS           1\r
+\r
+/**\r
+ * @brief Enable/Disable asserts for the MQTT library.\r
+ *\r
+ * Set this to 1 to perform sanity checks when using the MQTT library.\r
+ * Asserts are useful for debugging, but should be disabled in production code.\r
+ * If this is set to 1, IotMqtt_Assert can be defined to set the assertion\r
+ * function; otherwise, the standard library's assert function will be used.\r
+ *\r
+ * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
+ * Recommended values: 1 when debugging; 0 in production code.\r
+ * Default value (if undefined): 0\r
+ */\r
+#define IOT_MQTT_ENABLE_ASSERTS                 1\r
+\r
+/**\r
+ * @brief Enable/Disable anonymous metrics collection when using AWS IoT.\r
+ *\r
+ * This demo does not use TLS and so does not work with AWS IoT. Therefore,\r
+ * the metric collection must be disabled.\r
+ */\r
+#define AWS_IOT_MQTT_ENABLE_METRICS             0\r
+\r
+/* Common settings for FreeRTOS; settings below this line generally do not need\r
+ * to be changed. */\r
+\r
+/* Logging puts function on FreeRTOS. */\r
+#define IotLogging_Puts( str )    configPRINTF( ( "%s\r\n", str ) )\r
+\r
+/* Assert functions on FreeRTOS. */\r
+#define Iot_DefaultAssert    configASSERT\r
+\r
+/* Memory allocation functions on FreeRTOS. */\r
+#define Iot_DefaultMalloc    pvPortMalloc\r
+#define Iot_DefaultFree      vPortFree\r
+\r
+#endif /* ifndef IOT_CONFIG_H_ */\r