3 * Copyright (c) 2020 Project CHIP Authors
\r
4 * All rights reserved.
\r
6 * Licensed under the Apache License, Version 2.0 (the "License");
\r
7 * you may not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an "AS IS" BASIS,
\r
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
19 * Copyright (c) 2020, Qorvo Inc
\r
23 * This software is owned by Qorvo Inc
\r
24 * and protected under applicable copyright laws.
\r
25 * It is delivered under the terms of the license
\r
26 * and is intended and supplied for use solely and
\r
27 * exclusively with products manufactured by
\r
31 * THIS SOFTWARE IS PROVIDED IN AN "AS IS"
\r
32 * CONDITION. NO WARRANTIES, WHETHER EXPRESS,
\r
33 * IMPLIED OR STATUTORY, INCLUDING, BUT NOT
\r
34 * LIMITED TO, IMPLIED WARRANTIES OF
\r
35 * MERCHANTABILITY AND FITNESS FOR A
\r
36 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
37 * QORVO INC. SHALL NOT, IN ANY
\r
38 * CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
\r
39 * INCIDENTAL OR CONSEQUENTIAL DAMAGES,
\r
40 * FOR ANY REASON WHATSOEVER.
\r
43 * $DateTime: 2020/08/21 09:47:42 $
\r
47 /** @file "main.cpp"
\r
52 /*****************************************************************************
\r
53 * Includes Definitions
\r
54 *****************************************************************************/
\r
57 #include "FreeRTOS.h"
\r
60 // Qorvo CHIP library
\r
64 #include <platform/CHIPDeviceLayer.h>
\r
65 #include <support/logging/CHIPLogging.h>
\r
67 // Application level logic
\r
68 #include "AppTask.h"
\r
70 using namespace ::chip;
\r
71 using namespace ::chip::Inet;
\r
72 using namespace ::chip::DeviceLayer;
\r
73 using namespace ::chip::DeviceLayer::Internal;
\r
75 /*****************************************************************************
\r
77 *****************************************************************************/
\r
79 #define APP_NAME "Lock-app"
\r
81 /*****************************************************************************
\r
82 * External Function Definitions
\r
83 *****************************************************************************/
\r
85 /*****************************************************************************
\r
86 * Application Function Definitions
\r
87 *****************************************************************************/
\r
89 int Application_Init(void)
\r
91 int ret = CHIP_ERROR_MAX;
\r
93 /* Launch application task */
\r
94 ChipLogProgress(NotSpecified, "============================");
\r
95 ChipLogProgress(NotSpecified, "Qorvo " APP_NAME " Launching");
\r
96 ChipLogProgress(NotSpecified, "============================");
\r
98 ret = GetAppTask().StartAppTask();
\r
99 if (ret != CHIP_NO_ERROR)
\r
101 ChipLogError(NotSpecified, "GetAppTask().Init() failed");
\r
108 int CHIP_Init(void)
\r
110 int ret = CHIP_ERROR_MAX;
\r
112 ChipLogProgress(NotSpecified, "Init CHIP Stack");
\r
113 ret = PlatformMgr().InitChipStack();
\r
114 if (ret != CHIP_NO_ERROR)
\r
116 ChipLogError(NotSpecified, "PlatformMgr().InitChipStack() failed");
\r
120 ChipLogProgress(NotSpecified, "Starting Platform Manager Event Loop");
\r
121 ret = PlatformMgr().StartEventLoopTask();
\r
122 if (ret != CHIP_NO_ERROR)
\r
124 ChipLogError(NotSpecified, "PlatformMgr().StartEventLoopTask() failed");
\r
132 /*****************************************************************************
\r
134 *****************************************************************************/
\r
140 /* Initialize Qorvo stack */
\r
141 result = qvCHIP_init();
\r
147 /* Initialize CHIP stack */
\r
148 result = CHIP_Init();
\r
149 if (result != CHIP_NO_ERROR)
\r
154 /* Application task */
\r
155 result = Application_Init();
\r
161 /* Start FreeRTOS */
\r
162 vTaskStartScheduler();
\r