Skip to content

Commit af74ecf

Browse files
adabreutirestyled-commits
andauthoredAug 15, 2023
[TI] Resolve build issues in Example Applications (project-chip#28508)
* Update TI Example applications to correctly pull in requirements.txt - Fix application build failures * Adjust return value to properly exit post-commissioning * Resolve run-time failure when using MTD configuration * Update OT TI Configuration * Disable Progress logging on lighting app for size constraints * Restyled by clang-format * Restyled by gn --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 383975f commit af74ecf

File tree

28 files changed

+64
-21
lines changed

28 files changed

+64
-21
lines changed
 

‎examples/all-clusters-app/cc13x2x7_26x2x7/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/all-clusters-app/cc13x4_26x4/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/all-clusters-app/cc13x4_26x4/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16+
import("${chip_root}/config/standalone/args.gni")
1617
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")
1718

1819
ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")

‎examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,13 @@ int AppTask::Init()
216216
;
217217
}
218218

219-
#ifdef CONFIG_OPENTHREAD_MTD_SED
219+
#if CHIP_DEVICE_CONFIG_THREAD_FTD
220+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
221+
#elif CONFIG_OPENTHREAD_MTD_SED
220222
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
221-
#elif CONFIG_OPENTHREAD_MTD
222-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
223223
#else
224-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
224+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
225225
#endif
226-
227226
if (ret != CHIP_NO_ERROR)
228227
{
229228
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");

‎examples/lighting-app/cc13x2x7_26x2x7/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/lighting-app/cc13x2x7_26x2x7/args.gni

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ chip_openthread_ftd = false
3333
openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x2_26x2:libopenthread-cc13x2_cc26x2"
3434

3535
# Disable CHIP Logging
36-
#chip_progress_logging = false
36+
chip_progress_logging = false
37+
3738
#chip_detail_logging = false
3839
#chip_automation_logging = false
3940

‎examples/lighting-app/cc13x4_26x4/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/lock-app/cc13x2x7_26x2x7/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/lock-app/cc13x2x7_26x2x7/args.gni

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc
3434

3535
# Disable CHIP Logging
3636
chip_progress_logging = false
37-
chip_detail_logging = false
37+
38+
#chip_detail_logging = false
3839
chip_automation_logging = false
3940

4041
# BLE options

‎examples/lock-app/cc13x4_26x4/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/lock-app/cc13x4_26x4/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16+
import("${chip_root}/config/standalone/args.gni")
1617
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")
1718

1819
ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")

‎examples/platform/cc13x2_26x2/project_include/OpenThreadConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@
9696
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1
9797

9898
// Use the TI-supplied default platform configuration for remainder
99-
#include "openthread-core-cc13xx_cc26xx-config.h"
99+
#include "openthread-core-cc13xx_cc26xx-config-matter.h"

‎examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@
9696
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1
9797

9898
// Use the TI-supplied default platform configuration for remainder
99-
#include "openthread-core-cc13xx_cc26xx-config.h"
99+
#include "openthread-core-cc13xx_cc26xx-config-matter.h"

‎examples/pump-app/cc13x2x7_26x2x7/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,14 @@ int AppTask::Init()
156156
;
157157
}
158158

159-
#ifdef CONFIG_OPENTHREAD_MTD_SED
159+
#if CHIP_DEVICE_CONFIG_THREAD_FTD
160+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
161+
#elif CONFIG_OPENTHREAD_MTD_SED
160162
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
161-
#elif CONFIG_OPENTHREAD_MTD
162-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
163163
#else
164-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
164+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
165165
#endif
166+
166167
if (ret != CHIP_NO_ERROR)
167168
{
168169
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");

‎examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "AppConfig.h"
2828
#include "PumpManager.h"
2929

30+
#include <app-common/zap-generated/ids/Attributes.h>
31+
#include <app-common/zap-generated/ids/Clusters.h>
3032
#include <app/server/Dnssd.h>
3133
#include <app/util/util.h>
3234
#include <lib/support/CodeUtils.h>

‎examples/pump-app/cc13x4_26x4/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/pump-app/cc13x4_26x4/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16+
import("${chip_root}/config/standalone/args.gni")
1617
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")
1718

1819
ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")

‎examples/pump-app/cc13x4_26x4/main/AppTask.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ int AppTask::Init()
157157
;
158158
}
159159

160-
#ifdef CONFIG_OPENTHREAD_MTD_SED
160+
#if CHIP_DEVICE_CONFIG_THREAD_FTD
161+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
162+
#elif CONFIG_OPENTHREAD_MTD_SED
161163
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
162-
#elif CONFIG_OPENTHREAD_MTD
163-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
164164
#else
165-
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
165+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
166166
#endif
167167
if (ret != CHIP_NO_ERROR)
168168
{

‎examples/pump-app/cc13x4_26x4/main/DeviceCallbacks.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "AppConfig.h"
2828
#include "PumpManager.h"
2929

30+
#include <app-common/zap-generated/ids/Attributes.h>
31+
#include <app-common/zap-generated/ids/Clusters.h>
3032
#include <app/server/Dnssd.h>
3133
#include <app/util/util.h>
3234
#include <lib/support/CodeUtils.h>

‎examples/pump-controller-app/cc13x2x7_26x2x7/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,14 @@ int AppTask::Init()
145145
;
146146
}
147147

148+
#if CHIP_DEVICE_CONFIG_THREAD_FTD
148149
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
150+
#elif CONFIG_OPENTHREAD_MTD_SED
151+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
152+
#else
153+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
154+
#endif
155+
149156
if (ret != CHIP_NO_ERROR)
150157
{
151158
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");

‎examples/pump-controller-app/cc13x4_26x4/.gn

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ default_args = {
2525
target_os = "freertos"
2626

2727
import("//args.gni")
28+
pw_build_PIP_REQUIREMENTS +=
29+
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
2830
}

‎examples/pump-controller-app/cc13x4_26x4/args.gni

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import("//build_overrides/chip.gni")
16+
import("${chip_root}/config/standalone/args.gni")
1617
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")
1718

1819
ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")

‎examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,14 @@ int AppTask::Init()
145145
;
146146
}
147147

148+
#if CHIP_DEVICE_CONFIG_THREAD_FTD
148149
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
150+
#elif CONFIG_OPENTHREAD_MTD_SED
151+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
152+
#else
153+
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
154+
#endif
155+
149156
if (ret != CHIP_NO_ERROR)
150157
{
151158
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");

‎scripts/setup/requirements.ti.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
ecdsa>=0.17.0
2+
intelhex

‎src/platform/cc13xx_26xx/BLEManagerImpl.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@ bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId)
266266
void * pMsg = (void *) ICall_malloc(sizeof(void *));
267267
pMsg = (void *) conId;
268268

269-
EnqueueEvtHdrMsg(BLEManagerIMPL_CHIPOBLE_CLOSE_CONN_EVT, (void *) pMsg);
270-
271-
return false;
269+
return (EnqueueEvtHdrMsg(BLEManagerIMPL_CHIPOBLE_CLOSE_CONN_EVT, (void *) pMsg) == true);
272270
}
273271

274272
uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const

0 commit comments

Comments
 (0)
Please sign in to comment.