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 /***
28  * See https://www.FreeRTOS.org/coremqtt for configuration and usage instructions.
29  ***/
30 
31 /* Standard includes. */
32 #include <stdio.h>
33 #include <time.h>
34 
35 /* Visual studio intrinsics used so the __debugbreak() function is available
36  * should an assert get hit. */
37 #include <intrin.h>
38 
39 /* FreeRTOS includes. */
40 #include "FreeRTOS.h"
41 #include "task.h"
42 
43 /* TCP/IP stack includes. */
44 #include "FreeRTOS_IP.h"
45 #include "FreeRTOS_Sockets.h"
46 
47 /* Demo logging includes. */
48 #include "logging.h"
49 
50 /* Demo Specific configs. */
51 #include "demo_config.h"
52 
53 /*-----------------------------------------------------------*/
54 
55 extern void prvJobsDemoTask( void * pvParameters );
56 extern void vPlatformInitLogging( void );
57 extern void vPlatformInitIpStack( void );
58 
59 /*-----------------------------------------------------------*/
60 
main(void)61 int main( void )
62 {
63     vPlatformInitLogging();
64 
65     /*
66      * This example uses a single application task, which shows that how to
67      * use Jobs library to generate and validate AWS IoT Jobs service MQTT topics
68      * via coreMQTT library to communicate with the AWS IoT Jobs service.
69      */
70     xTaskCreate( prvJobsDemoTask,          /* Function that implements the task. */
71                  "DemoTask",               /* Text name for the task - only used for debugging. */
72                  democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */
73                  NULL,                     /* Task parameter - not used in this case. */
74                  tskIDLE_PRIORITY,         /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */
75                  NULL );                   /* Used to pass out a handle to the created task - not used in this case. */
76 
77     /* Initialize the FreeRTOS+TCP Stack */
78     vPlatformInitIpStack();
79 
80     /* Start the RTOS scheduler. */
81     vTaskStartScheduler();
82 
83     /* If all is well, the scheduler will now be running, and the following
84      * line will never be reached.  If the following line does execute, then
85      * there was insufficient FreeRTOS heap memory available for the idle and/or
86      * timer tasks to be created.  See the memory management section on the
87      * FreeRTOS web site for more details.
88      */
89 
90     for( ; ; )
91     {
92         configASSERT( pdFALSE );
93     }
94 }
95 
96 /*-----------------------------------------------------------*/
97