1/* 2 * FreeRTOS V202212.00 3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 * this software and associated documentation files (the "Software"), to deal in 7 * the Software without restriction, including without limitation the rights to 8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 * the Software, and to permit persons to whom the Software is furnished to do so, 10 * subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in all 13 * copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 * 22 * https://www.FreeRTOS.org 23 * https://aws.amazon.com/freertos 24 * 25 */ 26 27#ifndef DEMO_CONFIG_H 28#define DEMO_CONFIG_H 29 30/* FreeRTOS config include. */ 31#include "FreeRTOSConfig.h" 32 33/**************************************************/ 34/******* DO NOT CHANGE the following order ********/ 35/**************************************************/ 36 37/* Include logging header files and define logging macros in the following order: 38 * 1. Include the header file "logging_levels.h". 39 * 2. Define the LIBRARY_LOG_NAME and LIBRARY_LOG_LEVEL macros depending on 40 * the logging configuration for DEMO. 41 * 3. Include the header file "logging_stack.h", if logging is enabled for DEMO. 42 */ 43 44#include "logging_levels.h" 45 46/* Logging configuration for the Demo. */ 47#ifndef LIBRARY_LOG_NAME 48 #define LIBRARY_LOG_NAME "MQTTDemo" 49#endif 50 51#ifndef LIBRARY_LOG_LEVEL 52 #define LIBRARY_LOG_LEVEL LOG_INFO 53#endif 54#include "logging_stack.h" 55 56/************ End of logging configuration ****************/ 57 58/** 59 * @brief The MQTT client identifier used in this example. Each client identifier 60 * must be unique; so edit as required to ensure that no two clients connecting to 61 * the same broker use the same client identifier. 62 * 63 * #define democonfigCLIENT_IDENTIFIER "insert here." 64 */ 65#define democonfigCLIENT_IDENTIFIER <IOTThingName> 66 67/** 68 * @brief Endpoint of the MQTT broker to connect to. 69 * 70 * This demo application can be run with any MQTT broker, that supports mutual 71 * authentication. 72 * 73 * For AWS IoT MQTT broker, this is the Thing's REST API Endpoint. 74 * 75 * @note Your AWS IoT Core endpoint can be found in the AWS IoT console under 76 * Settings/Custom Endpoint, or using the describe-endpoint REST API (with 77 * AWS CLI command line tool). 78 * 79 * @note If you would like to setup an MQTT broker for running this demo, 80 * please see \`mqtt_broker_setup.txt\`. 81 * 82 * #define democonfigMQTT_BROKER_ENDPOINT "...insert here..." 83 */ 84#define democonfigMQTT_BROKER_ENDPOINT <IOTEndpoint> 85 86/** 87 * @brief The port to use for the demo. 88 * 89 * In general, port 8883 is for secured MQTT connections. 90 * 91 * @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol 92 * name. Using ALPN with this demo would require additional changes, including 93 * setting the \`pAlpnProtos\` member of the \`NetworkCredentials_t\` struct before 94 * forming the TLS connection. When using port 8883, ALPN is not required. 95 * 96 * #define democonfigMQTT_BROKER_PORT ( insert here. ) 97 */ 98#define democonfigMQTT_BROKER_PORT ( 8883 ) 99 100/** 101 * @brief Server's root CA certificate. 102 * 103 * For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT 104 * server and is publicly available. Refer to the AWS documentation available 105 * in the link below. 106 * https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs 107 * 108 * @note This certificate should be PEM-encoded. 109 * 110 * Must include the PEM header and footer: 111 * "-----BEGIN CERTIFICATE-----\n"\ 112 * "...base64 data...\n"\ 113 * "-----END CERTIFICATE-----\n" 114 * 115 * #define democonfigROOT_CA_PEM "...insert here..." 116 */ 117#define democonfigROOT_CA_PEM \ 118 "-----BEGIN CERTIFICATE-----\n" \ 119 "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \ 120 "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \ 121 "b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n" \ 122 "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" \ 123 "b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" \ 124 "ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" \ 125 "9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" \ 126 "IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" \ 127 "VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" \ 128 "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" \ 129 "jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" \ 130 "AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" \ 131 "A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" \ 132 "U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" \ 133 "N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" \ 134 "o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" \ 135 "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \ 136 "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ 137 "-----END CERTIFICATE-----\n" 138 139/** 140 * @brief Client certificate. 141 * 142 * For AWS IoT MQTT broker, refer to the AWS documentation below for details 143 * regarding client authentication. 144 * https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html 145 * 146 * @note This certificate should be PEM-encoded. 147 * 148 * Must include the PEM header and footer: 149 * "-----BEGIN CERTIFICATE-----\n"\ 150 * "...base64 data...\n"\ 151 * "-----END CERTIFICATE-----\n" 152 * 153 * #define democonfigCLIENT_CERTIFICATE_PEM "...insert here..." 154 */ 155#define democonfigCLIENT_CERTIFICATE_PEM \ 156<ClientCertificatePEM> 157 158/** 159 * @brief PEM-encoded client private key. 160 * 161 * Must include the PEM header and footer: 162 * "-----BEGIN RSA PRIVATE KEY-----\n"\ 163 * "...base64 data...\n"\ 164 * "-----END RSA PRIVATE KEY-----\n" 165 * 166 * #define democonfigCLIENT_PRIVATE_KEY_PEM "...insert here..." 167 */ 168#define democonfigCLIENT_PRIVATE_KEY_PEM \ 169<ClientPrivateKeyPEM> 170 171/** 172 * @brief An option to disable Server Name Indication. 173 * 174 * @note When using a local Mosquitto server setup, SNI needs to be disabled 175 * for an MQTT broker that only has an IP address but no hostname. However, 176 * SNI should be enabled whenever possible. 177 */ 178#define democonfigDISABLE_SNI ( pdFALSE ) 179 180/** 181 * @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker. 182 * 183 * If username/password based authentication is used, the demo will use appropriate TLS ALPN and 184 * SNI configurations as required for the Custom Authentication feature of AWS IoT. 185 * For more information, refer to the following documentation: 186 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt 187 * 188 * #define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 ) 189 */ 190#define democonfigUSE_AWS_IOT_CORE_BROKER ( 1 ) 191 192/** 193 * @brief The username value for authenticating client to the MQTT broker when 194 * username/password based client authentication is used. 195 * 196 * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for 197 * details regarding client authentication with a username and password. 198 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html 199 * An authorizer setup needs to be done, as mentioned in the above link, to use 200 * username/password based client authentication. 201 * 202 * #define democonfigCLIENT_USERNAME "...insert here..." 203 */ 204 205/** 206 * @brief The password value for authenticating client to the MQTT broker when 207 * username/password based client authentication is used. 208 * 209 * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for 210 * details regarding client authentication with a username and password. 211 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html 212 * An authorizer setup needs to be done, as mentioned in the above link, to use 213 * username/password based client authentication. 214 * 215 * #define democonfigCLIENT_PASSWORD "...insert here..." 216 */ 217 218/** 219 * @brief The name of the operating system that the application is running on. 220 * The current value is given as an example. Please update for your specific 221 * operating system. 222 */ 223#define democonfigOS_NAME "FreeRTOS" 224 225/** 226 * @brief The version of the operating system that the application is running 227 * on. The current value is given as an example. Please update for your specific 228 * operating system version. 229 */ 230#define democonfigOS_VERSION tskKERNEL_VERSION_NUMBER 231 232/** 233 * @brief The name of the hardware platform the application is running on. The 234 * current value is given as an example. Please update for your specific 235 * hardware platform. 236 */ 237#define democonfigHARDWARE_PLATFORM_NAME "WinSim" 238 239/** 240 * @brief The name of the MQTT library used and its version, following an "@" 241 * symbol. 242 */ 243#define democonfigMQTT_LIB "core-mqtt@1.0.0" 244 245/** 246 * @brief Set the stack size of the main demo task. 247 * 248 * In the Windows port, this stack only holds a structure. The actual 249 * stack is created by an operating system thread. 250 */ 251#define democonfigDEMO_STACKSIZE configMINIMAL_STACK_SIZE 252 253/** 254 * @brief Size of the network buffer for MQTT packets. 255 */ 256#define democonfigNETWORK_BUFFER_SIZE ( 1024U ) 257 258#endif /* DEMO_CONFIG_H */