Skip to content

Commit

Permalink
[example] Fix flags in linux example app
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing committed Jan 27, 2021
1 parent 9318d13 commit 4495154
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions examples/lighting-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import("//build_overrides/chip.gni")

import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/platform/device.gni")

assert(chip_build_tools)

Expand All @@ -35,6 +36,11 @@ executable("chip-tool-server") {
"main.cpp",
]

defines = [
"CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}",
"CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}",
]

if (is_debug) {
defines = [ "BUILD_RELEASE=0" ]
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/linux/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ot-ctl panid 0x1234
ot-ctl ifconfig up
ot-ctl thread start

chip-tool-server
chip-tool-server --thread
6 changes: 4 additions & 2 deletions examples/lighting-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,16 @@ int main(int argc, char * argv[])
#if CHIP_DEVICE_CONFIG_ENABLE_WPA
if (LinuxDeviceOptions::GetInstance().mWiFi)
{
chip::DeviceLayer::ConnectivityMgrImpl().StartWiFiManagement();
SuccessOrExit(err = chip::DeviceLayer::ConnectivityMgrImpl().StartWiFiManagement());
std::cerr << "WiFi Management initialized." << std::endl;
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA

#if CHIP_ENABLE_OPENTHREAD
if (LinuxDeviceOptions::GetInstance().mThread)
{
chip::DeviceLayer::ThreadStackMgrImpl().InitThreadStack();
SuccessOrExit(err = chip::DeviceLayer::ThreadStackMgrImpl().InitThreadStack());
std::cerr << "Thread initialized." << std::endl;
}
#endif // CHIP_ENABLE_OPENTHREAD

Expand Down
2 changes: 1 addition & 1 deletion src/test_driver/linux-cirque/test-on-off-cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def run_data_model_test(self):
for device_id in server_ids:
self.logger.info("checking device log for {}".format(
self.get_device_pretty_id(device_id)))
self.assertTrue(self.sequenceMatch(self.get_device_log(device_id).decode('utf-8'), ["LightingManager::InitiateAction(ON_ACTION)", "LightingManager::InitiateAction(OFF_ACTION)"]),
self.assertTrue(self.sequenceMatch(self.get_device_log(device_id).decode('utf-8'), ["Thread initialized.", "LightingManager::InitiateAction(ON_ACTION)", "LightingManager::InitiateAction(OFF_ACTION)"]),
"Datamodel test failed: cannot find matching string from device {}".format(device_id))


Expand Down

0 comments on commit 4495154

Please sign in to comment.