Skip to content

Commit

Permalink
[TI] Resolve build issues in Example Applications (#28508)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
adabreuti and restyled-commits authored Aug 15, 2023
1 parent 383975f commit af74ecf
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 21 deletions.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x4_26x4/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
1 change: 1 addition & 0 deletions examples/all-clusters-app/cc13x4_26x4/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")

ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")
Expand Down
9 changes: 4 additions & 5 deletions examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,13 @@ int AppTask::Init()
;
}

#ifdef CONFIG_OPENTHREAD_MTD_SED
#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#elif CONFIG_OPENTHREAD_MTD_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#elif CONFIG_OPENTHREAD_MTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif

if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
3 changes: 2 additions & 1 deletion examples/lighting-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ chip_openthread_ftd = false
openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x2_26x2:libopenthread-cc13x2_cc26x2"

# Disable CHIP Logging
#chip_progress_logging = false
chip_progress_logging = false

#chip_detail_logging = false
#chip_automation_logging = false

Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/cc13x4_26x4/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
3 changes: 2 additions & 1 deletion examples/lock-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc

# Disable CHIP Logging
chip_progress_logging = false
chip_detail_logging = false

#chip_detail_logging = false
chip_automation_logging = false

# BLE options
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x4_26x4/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
1 change: 1 addition & 0 deletions examples/lock-app/cc13x4_26x4/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")

ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1

// Use the TI-supplied default platform configuration for remainder
#include "openthread-core-cc13xx_cc26xx-config.h"
#include "openthread-core-cc13xx_cc26xx-config-matter.h"
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1

// Use the TI-supplied default platform configuration for remainder
#include "openthread-core-cc13xx_cc26xx-config.h"
#include "openthread-core-cc13xx_cc26xx-config-matter.h"
2 changes: 2 additions & 0 deletions examples/pump-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
9 changes: 5 additions & 4 deletions examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ int AppTask::Init()
;
}

#ifdef CONFIG_OPENTHREAD_MTD_SED
#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#elif CONFIG_OPENTHREAD_MTD_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#elif CONFIG_OPENTHREAD_MTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif

if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "AppConfig.h"
#include "PumpManager.h"

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Dnssd.h>
#include <app/util/util.h>
#include <lib/support/CodeUtils.h>
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-app/cc13x4_26x4/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
1 change: 1 addition & 0 deletions examples/pump-app/cc13x4_26x4/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")

ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")
Expand Down
8 changes: 4 additions & 4 deletions examples/pump-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ int AppTask::Init()
;
}

#ifdef CONFIG_OPENTHREAD_MTD_SED
#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#elif CONFIG_OPENTHREAD_MTD_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#elif CONFIG_OPENTHREAD_MTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif
if (ret != CHIP_NO_ERROR)
{
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-app/cc13x4_26x4/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "AppConfig.h"
#include "PumpManager.h"

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Dnssd.h>
#include <app/util/util.h>
#include <lib/support/CodeUtils.h>
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-controller-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
7 changes: 7 additions & 0 deletions examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#elif CONFIG_OPENTHREAD_MTD_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif

if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
2 changes: 2 additions & 0 deletions examples/pump-controller-app/cc13x4_26x4/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ default_args = {
target_os = "freertos"

import("//args.gni")
pw_build_PIP_REQUIREMENTS +=
[ "${chip_root}/scripts/setup/requirements.ti.txt" ]
}
1 change: 1 addition & 0 deletions examples/pump-controller-app/cc13x4_26x4/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/examples/platform/cc13x4_26x4/args.gni")

ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain")
Expand Down
7 changes: 7 additions & 0 deletions examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#elif CONFIG_OPENTHREAD_MTD_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif

if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
1 change: 1 addition & 0 deletions scripts/setup/requirements.ti.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ecdsa>=0.17.0
intelhex
4 changes: 1 addition & 3 deletions src/platform/cc13xx_26xx/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId)
void * pMsg = (void *) ICall_malloc(sizeof(void *));
pMsg = (void *) conId;

EnqueueEvtHdrMsg(BLEManagerIMPL_CHIPOBLE_CLOSE_CONN_EVT, (void *) pMsg);

return false;
return (EnqueueEvtHdrMsg(BLEManagerIMPL_CHIPOBLE_CLOSE_CONN_EVT, (void *) pMsg) == true);
}

uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const
Expand Down

0 comments on commit af74ecf

Please sign in to comment.