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://github.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    "JobsDemo"
49 #endif
50 
51 #ifndef LIBRARY_LOG_LEVEL
52     #define LIBRARY_LOG_LEVEL    LOG_INFO
53 #endif
54 
55 /* Prototype for the function used to print to console on Windows simulator
56  * of FreeRTOS.
57  * The function prints to the console before the network is connected;
58  * then a UDP port after the network has connected. */
59 extern void vLoggingPrintf( const char * pcFormatString,
60                             ... );
61 
62 /* Map the SdkLog macro to the logging function to enable logging
63  * on Windows simulator. */
64 #ifndef SdkLog
65     #define SdkLog( message )    vLoggingPrintf message
66 #endif
67 
68 #include "logging_stack.h"
69 
70 /************ End of logging configuration ****************/
71 
72 /**
73  * @brief The Thing resource registered on your AWS IoT account to use in the demo.
74  * A Thing resource is required to communicate with the AWS IoT Jobs service.
75  *
76  * @note The Things associated with your AWS account can be found in the
77  * AWS IoT console under Manage/Things, or using the ListThings REST API (that can
78  * be called with the AWS CLI command line tool).
79  *
80  * #define democonfigTHING_NAME    "...insert here..."
81  */
82 
83 /**
84  * @brief The MQTT client identifier used in this example.  Each client identifier
85  * must be unique so edit as required to ensure no two clients connecting to the
86  * same broker use the same client identifier.
87  *
88  * #define democonfigCLIENT_IDENTIFIER "...insert here..."
89  */
90 
91 /**
92  * @brief The AWS IoT broker endpoint to connect to in the demo.
93  *
94  * @note Your AWS IoT Core endpoint can be found in the AWS IoT console under
95  * Settings/Custom Endpoint, or using the describe-endpoint REST API (with
96  * AWS CLI command line tool).
97  *
98  * #define democonfigMQTT_BROKER_ENDPOINT    "...insert here..."
99  */
100 
101 /**
102  * @brief The port to use for the demo.
103  *
104  * In general, port 8883 is for secured MQTT connections.
105  *
106  * @note Port 443 requires use of the ALPN TLS extension with the ALPN protocol
107  * name. Using ALPN with this demo would require additional changes, including
108  * setting the `pAlpnProtos` member of the `NetworkCredentials_t` struct before
109  * forming the TLS connection. When using port 8883, ALPN is not required.
110  *
111  * #define democonfigMQTT_BROKER_PORT    ( insert here. )
112  */
113 
114 /**
115  * @brief Root CA certificate of AWS IoT broker.
116  *
117  * This certificate is used to identify the AWS IoT server and is publicly
118  * available. Refer to the link below.
119  * https://www.amazontrust.com/repository/AmazonRootCA1.pem
120  *
121  * @note This certificate should be PEM-encoded.
122  *
123  * Must include the PEM header and footer:
124  * "-----BEGIN CERTIFICATE-----\n"\
125  * "...base64 data...\n"\
126  * "-----END CERTIFICATE-----\n"
127  *
128  * #define democonfigROOT_CA_PEM    "...insert here..."
129  */
130 
131 /**
132  * @brief Client certificate.
133  *
134  * Please refer to the AWS documentation below for details
135  * regarding client authentication.
136  * https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
137  *
138  * @note This certificate should be PEM-encoded.
139  *
140  * Must include the PEM header and footer:
141  * "-----BEGIN CERTIFICATE-----\n"\
142  * "...base64 data...\n"\
143  * "-----END CERTIFICATE-----\n"
144  *
145  * #define democonfigCLIENT_CERTIFICATE_PEM    "...insert here..."
146  */
147 
148 /**
149  * @brief Client's private key.
150  *
151  * Please refer to the AWS documentation below for details
152  * regarding client authentication.
153  * https://docs.aws.amazon.com/iot/latest/developerguide/client-authentication.html
154  *
155  * @note This private key should be PEM-encoded.
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 The username value for authenticating client to the MQTT broker when
167  * username/password based client authentication is used.
168  *
169  * Please refer to the AWS IoT documentation below for
170  * details regarding client authentication with a username and password.
171  * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
172  * An authorizer setup needs to be done, as mentioned in the above link, to use
173  * username/password based client authentication.
174  *
175  * #define democonfigCLIENT_USERNAME    "...insert here..."
176  */
177 
178 /**
179  * @brief The password value for authenticating client to the MQTT broker when
180  * username/password based client authentication is used.
181  *
182  * Please refer to the AWS IoT documentation below for
183  * details regarding client authentication with a username and password.
184  * https://docs.aws.amazon.com/iot/latest/developerguide/custom-authentication.html
185  * An authorizer setup needs to be done, as mentioned in the above link, to use
186  * username/password based client authentication.
187  *
188  * #define democonfigCLIENT_PASSWORD    "...insert here..."
189  */
190 
191 /**
192  * @brief The name of the operating system that the application is running on.
193  * The current value is given as an example. Please update for your specific
194  * operating system.
195  */
196 #define democonfigOS_NAME                   "FreeRTOS"
197 
198 /**
199  * @brief The version of the operating system that the application is running
200  * on. The current value is given as an example. Please update for your specific
201  * operating system version.
202  */
203 #define democonfigOS_VERSION                tskKERNEL_VERSION_NUMBER
204 
205 /**
206  * @brief The name of the hardware platform the application is running on. The
207  * current value is given as an example. Please update for your specific
208  * hardware platform.
209  */
210 #define democonfigHARDWARE_PLATFORM_NAME    "WinSim"
211 
212 /**
213  * @brief The name of the MQTT library used and its version, following an "@"
214  * symbol.
215  */
216 #include "core_mqtt.h" /* Include coreMQTT header for MQTT_LIBRARY_VERSION macro. */
217 #define democonfigMQTT_LIB               "core-mqtt@"MQTT_LIBRARY_VERSION
218 
219 /**
220  * @brief Set the stack size of the main demo task.
221  *
222  * In the Windows port, this stack only holds a structure. The actual
223  * stack is created by an operating system thread.
224  */
225 #define democonfigDEMO_STACKSIZE         configMINIMAL_STACK_SIZE
226 
227 /**
228  * @brief Size of the network buffer for MQTT packets.
229  */
230 #define democonfigNETWORK_BUFFER_SIZE    ( 1024U )
231 
232 #endif /* DEMO_CONFIG_H */
233