Skip to content

Commit

Permalink
Copy the latest Chef codes from master 0e3434a
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinpan1 committed Aug 30, 2024
1 parent b04b3e5 commit 09eb429
Show file tree
Hide file tree
Showing 164 changed files with 28,751 additions and 1,240 deletions.
1 change: 0 additions & 1 deletion examples/chef/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ target_include_directories(
${chip_dir}/src/app/server/
${chip_dir}/src/controller/data_model
${chip_dir}/third_party/nlio/repo/include/
${chip_dir}/third_party/nlunit-test/repo/src
)

list(
Expand Down
7 changes: 3 additions & 4 deletions examples/chef/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
err = PlatformMgr().InitChipStack();
SuccessOrExit(err);

if (CONFIG_NETWORK_LAYER_BLE)
{
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
}
#if CONFIG_NETWORK_LAYER_BLE
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
#endif

// Register a function to receive events from the CHIP device layer. Note that calls to
// this function will happen on the CHIP event loop thread, not the app_main thread.
Expand Down
1 change: 0 additions & 1 deletion examples/chef/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/af.h>
#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
Expand Down
30 changes: 23 additions & 7 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def bundle_nrfconnect(device_name: str) -> None:
nrf_root = os.path.join(_CHEF_SCRIPT_PATH,
"nrfconnect",
"build",
"nrfconnect",
"zephyr")
scripts_root = os.path.join(_REPO_BASE_PATH,
"scripts",
Expand Down Expand Up @@ -696,11 +697,24 @@ def main() -> int:
if options.build_target == "esp32":
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/esp32")
if options.enable_ipv4:
shell.run_cmd(
"sed -i 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ")
if sys.platform == "darwin":
shell.run_cmd(
"sed -i '' 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ")
else:
shell.run_cmd(
"sed -i 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ")
else:
shell.run_cmd(
"sed -i 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ")
if sys.platform == "darwin":
shell.run_cmd(
"sed -i '' 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ")
shell.run_cmd(
"sed -i '' 's/CONFIG_LWIP_IPV4=y/#\\ CONFIG_LWIP_IPV4\\ is\\ not\\ set/g' sdkconfig ")
else:
shell.run_cmd(
"sed -i 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ")
shell.run_cmd(
"sed -i 's/CONFIG_LWIP_IPV4=y/#\\ CONFIG_LWIP_IPV4\\ is\\ not\\ set/g' sdkconfig ")

shell.run_cmd("idf.py build")
shell.run_cmd("idf.py build flashing_script")
shell.run_cmd(
Expand All @@ -710,9 +724,10 @@ def main() -> int:
f"cp build/$(git rev-parse HEAD)-{options.sample_device_type_name}.tar.xz {_CHEF_SCRIPT_PATH}")
elif options.build_target == "nrfconnect":
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/nrfconnect")
nrf_build_cmds = ["west build -b nrf52840dk_nrf52840"]
nrf_build_cmds = ["west build -b nrf52840dk/nrf52840"]
if options.do_clean:
nrf_build_cmds.append("-p always")
nrf_build_cmds.append("--sysbuild")
nrf_build_cmds.append("--")
if options.do_rpc:
nrf_build_cmds.append("-DOVERLAY_CONFIG=rpc.overlay")
Expand All @@ -723,7 +738,7 @@ def main() -> int:
nrf_build_cmds.append(
f"-DCONFIG_CHIP_DEVICE_PRODUCT_NAME='\"{options.pname}\"'")
nrf_build_cmds.append(
f"-DSAMPLE_NAME={options.sample_device_type_name}")
f"-DCONFIG_CHEF_DEVICE_TYPE='\"{options.sample_device_type_name}\"'")
nrf_build_cmds.append(
f"-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING='\"{sw_ver_string}\"'")

Expand Down Expand Up @@ -802,6 +817,7 @@ def main() -> int:
'chip_shell_cmd_server = false',
'chip_build_libshell = true',
'chip_enable_openthread = false',
'chip_generate_link_map_file = true',
'chip_config_network_layer_ble = false',
'chip_device_project_config_include = "<CHIPProjectAppConfig.h>"',
'chip_project_config_include = "<CHIPProjectAppConfig.h>"',
Expand Down Expand Up @@ -868,7 +884,7 @@ def main() -> int:
"""))
if options.do_clean:
shell.run_cmd("rm -rf out")
shell.run_cmd("gn gen out")
shell.run_cmd("gn gen --export-compile-commands out")
shell.run_cmd("ninja -C out")

#
Expand Down
Loading

0 comments on commit 09eb429

Please sign in to comment.