Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rvc mode cluters with new mode restrictions #31560

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
62ecf35
Updated step 3 in TC 1.1 for RvcRunMode and RvcCleanMode
hicklin Jan 19, 2024
2c00c99
Updated TC 1.2 for RvcRunMode and RvcCleanMode cluters.
hicklin Jan 19, 2024
7227a80
Added TC 2.2 for the RvcCleanMode cluster.
hicklin Jan 19, 2024
76cbde1
Restyled by autopep8
restyled-commits Jan 19, 2024
d3ffb58
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 22, 2024
cc5e3ed
Added TC 2.2 for the RvcRunMode cluster.
hicklin Jan 22, 2024
5dde47b
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 22, 2024
647d4f7
Removed unused imports.
hicklin Jan 22, 2024
423daf4
Regenerated zap files.
hicklin Jan 22, 2024
754d8de
Added the PICS provider methods to the new python tests.
hicklin Jan 22, 2024
a97b2c5
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 22, 2024
cf781ab
Changed the features supported by the RVC mode cluters in the all-clu…
hicklin Jan 23, 2024
41a67ae
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 23, 2024
d508cbc
Added the mapping mode tag to the all-clusters-app example
hicklin Jan 23, 2024
e08330c
Changed the response returned by the RVC clean mode's handler of the …
hicklin Jan 24, 2024
48ace96
Updated TC_RVCCLEAN_2_2 to remove incorrect type checks.
hicklin Jan 24, 2024
18f5040
Apply suggestions from code review
hicklin Jan 24, 2024
9cd3186
Updated the RVC run ChangeToMode handler in the all-clusters-app to m…
hicklin Jan 24, 2024
8a122a1
Updated the cl-pics-values for the RVC Run and Clean clusters.
hicklin Jan 24, 2024
1a89bae
Future proofed the enum to text function and change to using the --en…
hicklin Jan 24, 2024
ddd30b6
Fixed retrival of the endpoint setting.
hicklin Jan 24, 2024
1d066c4
Simplified some of the test code following review.
hicklin Jan 24, 2024
45505e4
Removed test steps to match the test plan.
hicklin Jan 24, 2024
7f2861c
Changed the capture of the endpoint for the RVC run and RVC clean tes…
hicklin Jan 24, 2024
4e49153
Restyled by clang-format
restyled-commits Jan 24, 2024
a8f10e6
Restyled by autopep8
restyled-commits Jan 24, 2024
d77738f
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 24, 2024
dc2f6ef
Regenerated zap files.
hicklin Jan 24, 2024
e46137d
Removed duplicate RVCRUNM PICS from the ci-pics-values.
hicklin Jan 25, 2024
f7ea7f5
Updated PICS.yaml to reflect the new PICS requirements for the RvcRun…
hicklin Jan 25, 2024
861434b
Made all RVC python tests consistent regarding the capture of the end…
hicklin Jan 25, 2024
98b544f
Apply typo suggestions from code review
hicklin Jan 25, 2024
31b6df2
Fixed the RVC clean handle change to mode in the all-clusters-app.
hicklin Jan 25, 2024
421186b
Merge branch 'update_rvc_mode_cluters_with_new_mode_restrictions' of …
hicklin Jan 25, 2024
7b08a3a
Restyled by clang-format
restyled-commits Jan 25, 2024
8329b67
Merge branch 'master' into update_rvc_mode_cluters_with_new_mode_rest…
hicklin Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class RvcRunModeDelegate : public ModeBase::Delegate
using ModeTagStructType = detail::Structs::ModeTagStruct::Type;
ModeTagStructType ModeTagsIdle[1] = { { .value = to_underlying(ModeTag::kIdle) } };
ModeTagStructType ModeTagsCleaning[1] = { { .value = to_underlying(ModeTag::kCleaning) } };
ModeTagStructType ModeTagsMapping[1] = { { .value = to_underlying(ModeTag::kMapping) } };

const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = {
detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Idle"),
Expand All @@ -49,10 +50,9 @@ class RvcRunModeDelegate : public ModeBase::Delegate
detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Cleaning"),
.mode = ModeCleaning,
.modeTags = DataModel::List<const ModeTagStructType>(ModeTagsCleaning) },
detail::Structs::ModeOptionStruct::Type{
.label = CharSpan::fromCharString("Mapping"),
.mode = ModeMapping,
.modeTags = DataModel::List<const ModeTagStructType>(ModeTagsIdle) }, // todo set to no mode tags
detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Mapping"),
.mode = ModeMapping,
.modeTags = DataModel::List<const ModeTagStructType>(ModeTagsMapping) },
};

CHIP_ERROR Init() override;
Expand Down
15 changes: 7 additions & 8 deletions examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void RvcRunModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands:
// Our business logic states that we can only switch into the mapping state from the idle state.
if (NewMode == RvcRunMode::ModeMapping && currentMode != RvcRunMode::ModeIdle)
{
response.status = to_underlying(ModeBase::StatusCode::kGenericFailure);
response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode);
response.statusText.SetValue(chip::CharSpan::fromCharString("Change to the mapping mode is only allowed from idle"));
return;
}
Expand Down Expand Up @@ -112,8 +112,7 @@ void emberAfRvcRunModeClusterInitCallback(chip::EndpointId endpointId)
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
VerifyOrDie(gRvcRunModeDelegate == nullptr && gRvcRunModeInstance == nullptr);
gRvcRunModeDelegate = new RvcRunMode::RvcRunModeDelegate;
gRvcRunModeInstance =
new ModeBase::Instance(gRvcRunModeDelegate, 0x1, RvcRunMode::Id, chip::to_underlying(RvcRunMode::Feature::kOnOff));
gRvcRunModeInstance = new ModeBase::Instance(gRvcRunModeDelegate, 0x1, RvcRunMode::Id, 0);
gRvcRunModeInstance->Init();
}

Expand All @@ -130,10 +129,11 @@ void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Command
{
uint8_t rvcRunCurrentMode = gRvcRunModeInstance->GetCurrentMode();

if (rvcRunCurrentMode == RvcRunMode::ModeCleaning)
if (rvcRunCurrentMode != RvcRunMode::ModeIdle)
{
response.status = to_underlying(RvcCleanMode::StatusCode::kCleaningInProgress);
response.statusText.SetValue(chip::CharSpan::fromCharString("Cannot change the cleaning mode during a clean"));
response.status = to_underlying(ModeBase::StatusCode::kInvalidInMode);
hicklin marked this conversation as resolved.
Show resolved Hide resolved
response.statusText.SetValue(
chip::CharSpan::fromCharString("Cannot change the cleaning mode when the device is not in idle"));
return;
}

Expand Down Expand Up @@ -201,7 +201,6 @@ void emberAfRvcCleanModeClusterInitCallback(chip::EndpointId endpointId)
VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1.
hicklin marked this conversation as resolved.
Show resolved Hide resolved
VerifyOrDie(gRvcCleanModeDelegate == nullptr && gRvcCleanModeInstance == nullptr);
gRvcCleanModeDelegate = new RvcCleanMode::RvcCleanModeDelegate;
gRvcCleanModeInstance =
new ModeBase::Instance(gRvcCleanModeDelegate, 0x1, RvcCleanMode::Id, chip::to_underlying(RvcCleanMode::Feature::kOnOff));
gRvcCleanModeInstance = new ModeBase::Instance(gRvcCleanModeDelegate, 0x1, RvcCleanMode::Id, 0);
gRvcCleanModeInstance->Init();
}
13 changes: 2 additions & 11 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9116,12 +9116,6 @@ PICS:
- label: "Does the device implement the CurrentMode attribute?"
id: RVCCLEANM.S.A0001

- label: "Does the device implement the StartUpMode attribute?"
id: RVCCLEANM.S.A0002

- label: "Does the device implement the OnMode attribute?"
id: RVCCLEANM.S.A0003

#
# server / Commands received
#
Expand Down Expand Up @@ -9334,11 +9328,8 @@ PICS:
- label: "Does the device implement the CurrentMode attribute?"
id: RVCRUNM.S.A0001

- label: "Does the device implement the StartUpMode attribute?"
id: RVCRUNM.S.A0002

- label: "Does the device implement the OnMode attribute?"
id: RVCRUNM.S.A0003
- label: "Can the mode change be manually controlled?"
id: RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED

#Commands received
- label: "Does the device implement receiving the ChangeToMode command?"
Expand Down
34 changes: 0 additions & 34 deletions src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,13 @@ tests:
type: int16u

- label: "Step 3: TH reads from the DUT the FeatureMap attribute."
PICS: " !RVCCLEANM.S.F00 "
command: "readAttribute"
attribute: "FeatureMap"
response:
value: 0
constraints:
type: bitmap32

- label:
"Step 3: Given RVCCLEANM.S.F00(DEPONOFF) ensure featuremap has the
correct bit set"
PICS: RVCCLEANM.S.F00
command: "readAttribute"
attribute: "FeatureMap"
response:
constraints:
type: bitmap32
hasMasksSet: [0x1]

plauric marked this conversation as resolved.
Show resolved Hide resolved
- label: "Step 4a: TH reads from the DUT the AttributeList attribute."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand All @@ -79,28 +67,6 @@ tests:
type: list
contains: [0, 1, 65528, 65529, 65531, 65532, 65533]

- label:
"Step 4c: TH reads the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF)
and optional attribute(OnMode) is in AttributeList from the DUT"
PICS: RVCCLEANM.S.F00
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [3]

- label:
"Step 4c: TH reads the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF)
and optional attribute(OnMode) is not in AttributeList from the DUT"
PICS: " !RVCCLEANM.S.F00 "
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
excludes: [3]

- label: "Step 5: TH reads from the DUT the EventList attribute."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand Down
36 changes: 1 addition & 35 deletions src/app/tests/suites/certification/Test_TC_RVCRUNM_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,14 @@ tests:
constraints:
type: int16u

- label: "Step 3a: TH reads from the DUT the FeatureMap attribute."
PICS: " !RVCRUNM.S.F00 "
- label: "Step 3: TH reads from the DUT the FeatureMap attribute."
command: "readAttribute"
attribute: "FeatureMap"
response:
value: 0
constraints:
type: bitmap32

- label:
"Step 3b: Given RVCRUNM.S.F00(DEPONOFF) ensure featuremap has the
correct bit set"
PICS: RVCRUNM.S.F00
command: "readAttribute"
attribute: "FeatureMap"
response:
constraints:
type: bitmap32
hasMasksSet: [0x1]

plauric marked this conversation as resolved.
Show resolved Hide resolved
- label: "Step 4a: TH reads from the DUT the AttributeList attribute."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand All @@ -79,28 +67,6 @@ tests:
type: list
contains: [0, 1, 65528, 65529, 65531, 65532, 65533]

- label:
"Step 4c: TH reads the Feature dependent(RVCRUNM.S.F00 - DEPONOFF) and
optional attribute(OnMode) is in AttributeList from the DUT"
PICS: RVCRUNM.S.F00
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [3]

- label:
"Step 4d: TH reads the Feature dependent(RVCRUNM.S.F00 - DEPONOFF) and
optional attribute(OnMode) is not in AttributeList from the DUT"
PICS: " !RVCRUNM.S.F00 "
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
excludes: [3]

- label: "Step 5: TH reads from the DUT the EventList attribute."
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
Expand Down
19 changes: 3 additions & 16 deletions src/app/tests/suites/certification/ci-pics-values
Original file line number Diff line number Diff line change
Expand Up @@ -2438,11 +2438,9 @@ RVCCLEANM.S=1
#Server
RVCCLEANM.S.A0000=1
RVCCLEANM.S.A0001=1
RVCCLEANM.S.A0002=0
RVCCLEANM.S.A0003=1

#Feature
RVCCLEANM.S.F00=1
RVCCLEANM.S.F00=0

#commands
RVCCLEANM.S.C00.Rsp=1
Expand Down Expand Up @@ -2506,19 +2504,18 @@ RVCOPSTATE.C.C04.Tx=1

# RVC RUN MODE CLUSTER
RVCRUNM.S=1
RVCRUNM.S.F00=1
RVCRUNM.S.F00=0

#Server
RVCRUNM.S.A0000=1
RVCRUNM.S.A0001=1
RVCRUNM.S.A0002=0
RVCRUNM.S.A0003=1

#Commands
RVCRUNM.S.C00.Rsp=1
RVCRUNM.S.C01.Tx=1

RVCRUNM.S.M.CAN_TEST_MODE_FAILURE=1
RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED=1

#PIXIT
PIXIT.RVCRUNM.MODE_CHANGE_FAIL=1
Expand Down Expand Up @@ -2691,16 +2688,6 @@ WASHERCTRL.S.M.ManuallyControlledSpin=1
WASHERCTRL.S.M.ManuallyControlledRinse=1
WASHERCTRL.S.M.ManuallyControlled=0

#RVC Run Mode
RVCRUNM.S=1
RVCRUNM.S.F00=1
RVCRUNM.S.A0000=1
RVCRUNM.S.A0001=1
RVCRUNM.S.A0002=0
RVCRUNM.S.A0003=1
RVCRUNM.S.C00.Rsp=1
RVCRUNM.S.C01.Tx=1

#Refrigerator Alarm
REFALM.S=1
REFALM.C=1
Expand Down
Loading
Loading