-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nrf fromtree] Make TestEventTrigger delegate testable and extensible…
… (#31724) * Make TestEventTrigger delegate testable and extensible - Make TestEventTriggerDelegate base class manage multiple sub-handlers. - Add unit tests for TestEventTriggerDelegate - Introduce an interface for generic TestEventTrigger handlers - Add Clear() method to Intrusive list to remove everything. - Document the fact that `emberAfHandleEventTrigger` should NOT be used - Update all examples as needed. - Renumber OTA and SmokeCO testevent trigger prefix to match new Matter 1.3 standard (first 16 bits == cluster ID being tested). - Clean-up dead code - Register OTA test event handler as intended. - Add TODOs for platforms to clean-up TestEventTriggerDelegate registration. - Updated BOOLCFG tests to use `--hex-arg` for PIXIT since `--int-arg` is too confusing with complex keys. Issue #31723 Testing done: - EEVSE Python tests using event triggers pass - SMOKECO YAML tests using event triggers pass - BOOLCFG Python tests using event triggers pass - TC_TestEventTrigger passes - New unit tests pass * Fix merge issue * Restyled by clang-format * Fix uninitialized variable access * Fix Ameba/Silabs build * Fix CopyString bound * More fixes of Ameba/Silabs build --------- Co-authored-by: Restyled.io <[email protected]> Cherry-picked from: 4cd1825
- Loading branch information
1 parent
f2dfb17
commit 70be330
Showing
67 changed files
with
3,903 additions
and
357 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <app/clusters/boolean-state-configuration-server/BooleanStateConfigurationTestEventTriggerHandler.h> | ||
#include <app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h> | ||
|
||
#include <platform/CHIPDeviceLayer.h> | ||
|
||
using namespace chip; | ||
using namespace chip::app::Clusters::BooleanStateConfiguration; | ||
using namespace chip::DeviceLayer; | ||
|
||
bool HandleBooleanStateConfigurationTestEventTrigger(uint64_t eventTrigger) | ||
{ | ||
BooleanStateConfigurationTrigger trigger = static_cast<BooleanStateConfigurationTrigger>(eventTrigger); | ||
|
||
switch (trigger) | ||
{ | ||
case BooleanStateConfigurationTrigger::kSensorTrigger: | ||
ChipLogProgress(Support, "[BooleanStateConfiguration-Test-Event] => Trigger sensor"); | ||
SetAllEnabledAlarmsActive(1); | ||
break; | ||
|
||
case BooleanStateConfigurationTrigger::kSensorUntrigger: | ||
ChipLogProgress(Support, "[BooleanStateConfiguration-Test-Event] => Untrigger sensor"); | ||
ClearAllAlarms(1); | ||
break; | ||
|
||
default: | ||
|
||
return false; | ||
} | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.