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
66/**
67 * @brief Endpoint of the MQTT broker to connect to.
68 *
69 * This demo application can be run with any MQTT broker, that supports mutual
70 * authentication.
71 *
72 * For AWS IoT MQTT broker, this is the Thing's REST API Endpoint.
73 *
74 * @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
75 * Settings/Custom Endpoint, or using the describe-endpoint REST API (with
76 * AWS CLI command line tool).
77 *
78 * @note If you would like to setup an MQTT broker for running this demo,
79 * please see \`mqtt_broker_setup.txt\`.
80 *
81 * #define democonfigMQTT_BROKER_ENDPOINT    "...insert here..."
82 */
83
84/**
85 * @brief The port to use for the demo.
86 *
87 * In general, port 8883 is for secured MQTT connections.
88 *
89 * @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
90 * name. Using ALPN with this demo would require additional changes, including
91 * setting the \`pAlpnProtos\` member of the \`NetworkCredentials_t\` struct before
92 * forming the TLS connection. When using port 8883, ALPN is not required.
93 *
94 * #define democonfigMQTT_BROKER_PORT    ( insert here. )
95 */
96#define democonfigMQTT_BROKER_PORT    ( 8883 )
97
98/**
99 * @brief Server's root CA certificate.
100 *
101 * For AWS IoT MQTT broker, this certificate is used to identify the AWS IoT
102 * server and is publicly available. Refer to the AWS documentation available
103 * in the link below.
104 * https://docs.aws.amazon.com/iot/latest/developerguide/server-authentication.html#server-authentication-certs
105 *
106 * @note This certificate should be PEM-encoded.
107 *
108 * Must include the PEM header and footer:
109 * "-----BEGIN CERTIFICATE-----\n"\
110 * "...base64 data...\n"\
111 * "-----END CERTIFICATE-----\n"
112 *
113 * #define democonfigROOT_CA_PEM    "...insert here..."
114 */
115#define democonfigROOT_CA_PEM                                             \
116    "-----BEGIN CERTIFICATE-----\\n"                                      \\
117    "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\\n" \\
118    "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\\n" \\
119    "b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\\n" \\
120    "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\\n" \\
121    "b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\\n" \\
122    "ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\\n" \\
123    "9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\\n" \\
124    "IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\\n" \\
125    "VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\\n" \\
126    "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\\n" \\
127    "jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\\n" \\
128    "AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\\n" \\
129    "A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\\n" \\
130    "U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\\n" \\
131    "N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\\n" \\
132    "o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\\n" \\
133    "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\\n" \\
134    "rqXRfboQnoZsG4q5WTP468SQvvG5\\n"                                     \\
135    "-----END CERTIFICATE-----\\n"
136
137/**
138 * @brief Client certificate.
139 *
140 * For AWS IoT MQTT broker, refer to the AWS documentation below for details
141 * regarding client authentication.
142 * https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
143 *
144 * @note This certificate should be PEM-encoded.
145 *
146 * Must include the PEM header and footer:
147 * "-----BEGIN CERTIFICATE-----\n"\
148 * "...base64 data...\n"\
149 * "-----END CERTIFICATE-----\n"
150 *
151 * #define democonfigCLIENT_CERTIFICATE_PEM    "...insert here..."
152 */
153
154/**
155 * @brief PEM-encoded client private key.
156 *
157 * Must include the PEM header and footer:
158 * "-----BEGIN RSA PRIVATE KEY-----\\n"\\
159 * "...base64 data...\\n"\\
160 * "-----END RSA PRIVATE KEY-----\\n"
161 *
162 * #define democonfigCLIENT_PRIVATE_KEY_PEM    "...insert here..."
163 */
164
165/**
166 * @brief An option to disable Server Name Indication.
167 *
168 * @note When using a local Mosquitto server setup, SNI needs to be disabled
169 * for an MQTT broker that only has an IP address but no hostname. However,
170 * SNI should be enabled whenever possible.
171 */
172#define democonfigDISABLE_SNI    ( pdFALSE )
173
174/**
175 * @brief Configuration that indicates if the demo connection is made to the AWS IoT Core MQTT broker.
176 *
177 * If username/password based authentication is used, the demo will use appropriate TLS ALPN and
178 * SNI configurations as required for the Custom Authentication feature of AWS IoT.
179 * For more information, refer to the following documentation:
180 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-auth.html#custom-auth-mqtt
181 *
182 * #define democonfigUSE_AWS_IOT_CORE_BROKER    ( 1 )
183 */
184
185/**
186 * @brief The username value for authenticating client to the MQTT broker when
187 * username/password based client authentication is used.
188 *
189 * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
190 * details regarding client authentication with a username and password.
191 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
192 * An authorizer setup needs to be done, as mentioned in the above link, to use
193 * username/password based client authentication.
194 *
195 * #define democonfigCLIENT_USERNAME    "...insert here..."
196 */
197
198/**
199 * @brief The password value for authenticating client to the MQTT broker when
200 * username/password based client authentication is used.
201 *
202 * For AWS IoT MQTT broker, refer to the AWS IoT documentation below for
203 * details regarding client authentication with a username and password.
204 * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
205 * An authorizer setup needs to be done, as mentioned in the above link, to use
206 * username/password based client authentication.
207 *
208 * #define democonfigCLIENT_PASSWORD    "...insert here..."
209 */
210
211/**
212 * @brief The name of the operating system that the application is running on.
213 * The current value is given as an example. Please update for your specific
214 * operating system.
215 */
216#define democonfigOS_NAME                   "FreeRTOS"
217
218/**
219 * @brief The version of the operating system that the application is running
220 * on. The current value is given as an example. Please update for your specific
221 * operating system version.
222 */
223#define democonfigOS_VERSION                tskKERNEL_VERSION_NUMBER
224
225/**
226 * @brief The name of the hardware platform the application is running on. The
227 * current value is given as an example. Please update for your specific
228 * hardware platform.
229 */
230#define democonfigHARDWARE_PLATFORM_NAME    "WinSim"
231
232/**
233 * @brief The name of the MQTT library used and its version, following an "@"
234 * symbol.
235 */
236#define democonfigMQTT_LIB                  "core-mqtt@1.0.0"
237
238/**
239 * @brief Set the stack size of the main demo task.
240 *
241 * In the Windows port, this stack only holds a structure. The actual
242 * stack is created by an operating system thread.
243 */
244#define democonfigDEMO_STACKSIZE            configMINIMAL_STACK_SIZE
245
246/**
247 * @brief Size of the network buffer for MQTT packets.
248 */
249#define democonfigNETWORK_BUFFER_SIZE       ( 1024U )
250
251#endif /* DEMO_CONFIG_H */