Skip to content

Commit

Permalink
Fix a few sample app builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs committed Feb 3, 2022
1 parent b1c93d9 commit be8c1d7
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/light-switch-app/efr32/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
use_thread = false
chip_enable_wifi = true
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/clusters/level-control/level-control.cpp
${CHIP_ROOT}/src/app/clusters/color-control-server/color-control-server.cpp
${CHIP_ROOT}/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp
${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/efr32/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
use_thread = false
chip_enable_wifi = true
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/persistent-storage/qpg/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ import("//build_overrides/chip.gni")

import("${chip_root}/examples/platform/qpg/args.gni")
qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_openthread = false
3 changes: 3 additions & 0 deletions examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ config("shell_common_config") {
"ENABLE_CHIP_SHELL",
"OPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE",
"CHIP_SHELL_ENABLE_CMD_SERVER=${chip_shell_cmd_server}",

# shell app use openthread but do not have the NETWORK_COMMISSIONING cluster or zap config.
"_NO_NETWORK_COMMISSIONING_DRIVER_",
]
}

Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/efr32/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
use_thread = false
chip_enable_wifi = true
import("//build_for_wifi_args.gni")
}
4 changes: 3 additions & 1 deletion src/platform/EFR32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ static_library("EFR32") {
sources += [ "../OpenThread/DnssdImpl.cpp" ]
deps += [ "${chip_root}/src/lib/dnssd:platform_header" ]
}
} else {
}

if (chip_enable_wifi) {
sources += [
"ConnectivityManagerImpl_WIFI.cpp",
"ServiceProvisioning.cpp",
Expand Down
5 changes: 3 additions & 2 deletions src/platform/EFR32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
#define CHIP_DEVICE_CONFIG_EFR32_NVM3_ERROR_MIN 0xB00000
#define CHIP_DEVICE_CONFIG_EFR32_BLE_ERROR_MIN 0xC00000

#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0

#if defined(SL_WIFI)
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1
#elif CHIP_ENABLE_OPENTHREAD

#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 0
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ namespace Internal {

// Network commissioning
namespace {
#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_
NetworkCommissioning::GenericThreadDriver sGenericThreadDriver;
Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sGenericThreadDriver);
} // namespace
#endif

void initNetworkCommissioningThreadDriver(void)
{
#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_
sThreadNetworkCommissioningInstance.Init();
#endif
}

} // namespace
// Fully instantiate the generic implementation class in whatever compilation unit includes this file.
template class GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>;

Expand Down Expand Up @@ -305,7 +314,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::_GetThreadProvis
}

assert(Thread::kSizeOperationalDataset <= netInfo.size());
// memcpy(tlvs.mTlvs, netInfo.data(), netInfo.size());
netInfo = ByteSpan(datasetTlv.mTlvs, datasetTlv.mLength);

return CHIP_NO_ERROR;
Expand Down Expand Up @@ -1574,7 +1582,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::DoInit(otInstanc
ChipLogProgress(DeviceLayer, "OpenThread ifconfig up and thread start");
}

sThreadNetworkCommissioningInstance.Init();
initNetworkCommissioningThreadDriver();

exit:
ChipLogProgress(DeviceLayer, "OpenThread started: %s", otThreadErrorToString(otErr));
Expand Down
3 changes: 3 additions & 0 deletions src/test_driver/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ efr32_sdk("sdk") {
"BOARD_ID=${efr32_board}",
"EFR32_LOG_ENABLED=1",
"PW_RPC_ENABLED",

# Thread is built but test driver do not have the NETWORK_COMMISSIONING cluster or zap config.
"_NO_NETWORK_COMMISSIONING_DRIVER_",
]
}

Expand Down

0 comments on commit be8c1d7

Please sign in to comment.