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