Skip to content

Commit

Permalink
Merge branch 'master' into quickfix/TestAppTE2LaundryWasherControls
Browse files Browse the repository at this point in the history
  • Loading branch information
abeck-whirlpool authored Aug 11, 2023
2 parents 62de4bc + a98bc64 commit e9f0325
Show file tree
Hide file tree
Showing 95 changed files with 3,770 additions and 8,795 deletions.
7 changes: 6 additions & 1 deletion .github/actions/bootstrap/action.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Bootstrap
description: Bootstrap
inputs:
platform:
description: "Platform name"
required: false
default: none
runs:
using: "composite"
steps:
- name: Bootstrap
shell: bash
run: bash scripts/bootstrap.sh
run: bash scripts/bootstrap.sh -p all,${{ inputs.platform }}
2 changes: 2 additions & 0 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ runs:
uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
with:
platform: ${{ inputs.platform }}
- name: Upload Bootstrap Logs
uses: ./.github/actions/upload-bootstrap-logs
with:
Expand Down
12 changes: 10 additions & 2 deletions .github/issue-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
darwin:
- "(ios|homepod|darwin|mac|macos)"
# Make sure we don't match random words that contain "mac" inside.
#
# Make sure we don't match random words that contain "ios" inside
# (like "kiosk" or whatnot), but do allow matching "ios8" and things
# like that.
#
# \\b means "word boundary"
# (?![a-z]) means "there is no next char in the range a-z".
- "/(\\bios(?![a-z])|homepod|darwin|\\bmac\\b|macos)/i"

linux:
- "(linux)"
- "/(linux)/i"

# Special Keywords for Cert Blockers
air purifiers:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ jobs:
- name: Build Python REPL and example apps
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv --extra_packages "mobly"'
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \
Expand Down
168 changes: 166 additions & 2 deletions examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,173 @@
* limitations under the License.
*/

#include <lib/core/DataModelTypes.h>
#include <app/clusters/smoke-co-alarm-server/SmokeCOTestEventTriggerDelegate.h>
#include <app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h>

bool emberAfPluginSmokeCoAlarmSelfTestRequestCommand(chip::EndpointId endpointId)
#include <platform/CHIPDeviceLayer.h>

using namespace chip;
using namespace chip::app::Clusters::SmokeCoAlarm;
using namespace chip::DeviceLayer;

namespace {

constexpr const uint16_t kSelfTestingTimeoutSec = 10;

} // namespace

static std::array<ExpressedStateEnum, SmokeCoAlarmServer::kPriorityOrderLength> sPriorityOrder = {
ExpressedStateEnum::kSmokeAlarm, ExpressedStateEnum::kInterconnectSmoke, ExpressedStateEnum::kCOAlarm,
ExpressedStateEnum::kInterconnectCO, ExpressedStateEnum::kHardwareFault, ExpressedStateEnum::kTesting,
ExpressedStateEnum::kEndOfService, ExpressedStateEnum::kBatteryAlert
};

void EndSelfTestingEventHandler(System::Layer * systemLayer, void * appState)
{
SmokeCoAlarmServer::Instance().SetTestInProgress(1, false);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);

ChipLogProgress(Support, "[Smoke-CO-Alarm] => Self test complete");
}

bool emberAfPluginSmokeCoAlarmSelfTestRequestCommand(EndpointId endpointId)
{
SmokeCoAlarmServer::Instance().SetTestInProgress(1, true);

ChipLogProgress(Support, "[Smoke-CO-Alarm] => Self test running");

DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(kSelfTestingTimeoutSec), EndSelfTestingEventHandler, nullptr);

return true;
}

bool HandleSmokeCOTestEventTrigger(uint64_t eventTrigger)
{
SmokeCOTrigger trigger = static_cast<SmokeCOTrigger>(eventTrigger);

switch (trigger)
{
case SmokeCOTrigger::kForceSmokeCritical:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke (critical)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kCritical), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceSmokeWarning:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke (warning)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kWarning), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceSmokeInterconnect:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke interconnect (warning)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectSmokeAlarm(1, AlarmStateEnum::kWarning), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceCOCritical:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (critical)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kCritical), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceCOWarning:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (warning)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kWarning), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceCOInterconnect:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force CO (warning)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectCOAlarm(1, AlarmStateEnum::kWarning), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceSmokeContaminationHigh:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke contamination (critical)");
SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kCritical);
break;
case SmokeCOTrigger::kForceSmokeContaminationLow:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke contamination (warning)");
SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kLow);
break;
case SmokeCOTrigger::kForceSmokeSensitivityHigh:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke sensistivity (high)");
SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kHigh);
break;
case SmokeCOTrigger::kForceSmokeSensitivityLow:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force smoke sensitivity (low)");
SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kLow);
break;
case SmokeCOTrigger::kForceMalfunction:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force malfunction");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetHardwareFaultAlert(1, true), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceLowBatteryWarning:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force low battery (warning)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kWarning), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceLowBatteryCritical:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force low battery (critical)");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kCritical), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceEndOfLife:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force end-of-life");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetEndOfServiceAlert(1, EndOfServiceEnum::kExpired), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kForceSilence:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force silence");
SmokeCoAlarmServer::Instance().SetDeviceMuted(1, MuteStateEnum::kMuted);
break;
case SmokeCOTrigger::kClearSmoke:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear smoke");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetSmokeState(1, AlarmStateEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearCO:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear CO");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetCOState(1, AlarmStateEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearSmokeInterconnect:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear smoke interconnect");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectSmokeAlarm(1, AlarmStateEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearCOInterconnect:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear CO interconnect");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetInterconnectCOAlarm(1, AlarmStateEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearMalfunction:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear malfunction");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetHardwareFaultAlert(1, false), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearEndOfLife:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear end-of-life");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetEndOfServiceAlert(1, EndOfServiceEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearSilence:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear silence");
SmokeCoAlarmServer::Instance().SetDeviceMuted(1, MuteStateEnum::kNotMuted);
break;
case SmokeCOTrigger::kClearBatteryLevelLow:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear low battery");
VerifyOrReturnValue(SmokeCoAlarmServer::Instance().SetBatteryAlert(1, AlarmStateEnum::kNormal), true);
SmokeCoAlarmServer::Instance().SetExpressedStateByPriority(1, sPriorityOrder);
break;
case SmokeCOTrigger::kClearContamination:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Force SmokeContamination (warning)");
SmokeCoAlarmServer::Instance().SetContaminationState(1, ContaminationStateEnum::kNormal);
break;
case SmokeCOTrigger::kClearSensitivity:
ChipLogProgress(Support, "[Smoke-CO-Alarm-Test-Event] => Clear Smoke Sensitivity");
SmokeCoAlarmServer::Instance().SetSmokeSensitivityLevel(1, SensitivityEnum::kStandard);
break;
default:

return false;
}

return true;
}
28 changes: 0 additions & 28 deletions examples/all-clusters-app/linux/.kvs

This file was deleted.

1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]
matter_enable_tracing_support = true
matter_log_json_payload_decode_full = true
matter_log_json_payload_hex = true
chip_enable_smoke_co_trigger = true
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ source_set("chip-all-clusters-common") {

deps = [
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/examples/platform/tizen:app-main",
"${chip_root}/src/lib/shell:shell_core",
]

Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-minimal-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ source_set("chip-all-clusters-common") {

deps = [
"${chip_root}/examples/all-clusters-minimal-app/all-clusters-common",
"${chip_root}/examples/platform/tizen:app-main",
"${chip_root}/src/lib/shell:shell_core",
]

Expand Down
9 changes: 9 additions & 0 deletions examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
#include <app/clusters/ota-requestor/OTATestEventTriggerDelegate.h>
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER
#include <app/clusters/smoke-co-alarm-server/SmokeCOTestEventTriggerDelegate.h>
#endif
#include <app/TestEventTriggerDelegate.h>

#include <signal.h>
Expand Down Expand Up @@ -522,6 +525,12 @@ void ChipLinuxAppMainLoop(AppMainLoopImplementation * impl)
static OTATestEventTriggerDelegate otaTestEventTriggerDelegate{ ByteSpan(
LinuxDeviceOptions::GetInstance().testEventTriggerEnableKey) };
otherDelegate = &otaTestEventTriggerDelegate;
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER
static SmokeCOTestEventTriggerDelegate smokeCOTestEventTriggerDelegate{
ByteSpan(LinuxDeviceOptions::GetInstance().testEventTriggerEnableKey), otherDelegate
};
otherDelegate = &smokeCOTestEventTriggerDelegate;
#endif
// For general testing of TestEventTrigger, we have a common "core" event trigger delegate.
static SampleTestEventTriggerDelegate testEventTriggerDelegate;
Expand Down
13 changes: 13 additions & 0 deletions examples/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/lib/lib.gni")
import("${chip_root}/src/tracing/tracing_args.gni")

declare_args() {
chip_enable_smoke_co_trigger = false
}

config("app-main-config") {
include_dirs = [ "." ]
}
Expand All @@ -29,6 +33,10 @@ source_set("ota-test-event-trigger") {
]
}

source_set("smco-test-event-trigger") {
sources = [ "${chip_root}/src/app/clusters/smoke-co-alarm-server/SmokeCOTestEventTriggerDelegate.h" ]
}

source_set("app-main") {
defines = [ "ENABLE_TRACING=${matter_enable_tracing_support}" ]
sources = [
Expand All @@ -51,6 +59,7 @@ source_set("app-main") {
]

public_deps = [
":smco-test-event-trigger",
"${chip_root}/src/lib",
"${chip_root}/src/platform/logging:force_stdio",
]
Expand Down Expand Up @@ -85,6 +94,10 @@ source_set("app-main") {
]
}

if (chip_enable_smoke_co_trigger) {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_SMOKE_CO_TRIGGER=1" ]
}

public_configs = [ ":app-main-config" ]
}

Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/rs911x/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int32_t wfx_rsi_disconnect()
return status;
}

#if CHIP_CONFIG_ENABLE_ICD_SERVER
#if SL_ICD_ENABLED
/******************************************************************
* @fn wfx_rsi_power_save()
* @brief
Expand Down Expand Up @@ -215,7 +215,7 @@ int32_t wfx_rsi_power_save()
SILABS_LOG("Powersave Config Success");
return status;
}
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
#endif /* SL_ICD_ENABLED */

/******************************************************************
* @fn wfx_rsi_join_cb(uint16_t status, const uint8_t *buf, const uint16_t len)
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/rs911x/wfx_rsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap);
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info);
int32_t wfx_rsi_reset_count();
int32_t wfx_rsi_disconnect();
#if CHIP_CONFIG_ENABLE_ICD_SERVER
#if SL_ICD_ENABLED
int32_t wfx_rsi_power_save();
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
#endif /* SL_ICD_ENABLED */

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/rs911x/wfx_rsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ sl_status_t wfx_connect_to_ap(void)
return SL_STATUS_OK;
}

#if CHIP_CONFIG_ENABLE_ICD_SERVER
#if SL_ICD_ENABLED
/*********************************************************************
* @fn sl_status_t wfx_power_save()
* @brief
Expand All @@ -210,7 +210,7 @@ sl_status_t wfx_power_save()
}
return SL_STATUS_OK;
}
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
#endif /* SL_ICD_ENABLED */

/*********************************************************************
* @fn void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif)
Expand Down
Loading

0 comments on commit e9f0325

Please sign in to comment.