Skip to content

Commit

Permalink
Merge branch 'master' into remove_depricated_RVC_items
Browse files Browse the repository at this point in the history
  • Loading branch information
hicklin committed Jan 25, 2024
2 parents f768e20 + fe5dcfe commit 282567d
Show file tree
Hide file tree
Showing 19 changed files with 571 additions and 511 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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 @@ -132,10 +132,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);
response.statusText.SetValue(
chip::CharSpan::fromCharString("Cannot change the cleaning mode when the device is not in idle"));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/minimal-mdns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ unicast queries.
Example run:

```sh
./out/minimal_mdns/minimal-mdns-client -4
./out/minimal_mdns/minimal-mdns-client
```

which is likely to list a lot of answers.

You can customize the queries run:

```sh
/out/minimal_mdns/minimal-mdns-client -4 -q chip-mdns-demo._matter._tcp.local
./out/minimal_mdns/minimal-mdns-client -q chip-mdns-demo._matter._tcp.local
```

see
Expand Down
8 changes: 3 additions & 5 deletions src/app/clusters/descriptor/descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>

#include "descriptor.h"

using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
Expand All @@ -45,8 +47,6 @@ class DescriptorAttrAccess : public AttributeAccessInterface
CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;

private:
static constexpr uint16_t ClusterRevision = 2;

CHIP_ERROR ReadTagListAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder);
CHIP_ERROR ReadPartsAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder);
CHIP_ERROR ReadDeviceAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder);
Expand All @@ -55,8 +55,6 @@ class DescriptorAttrAccess : public AttributeAccessInterface
CHIP_ERROR ReadFeatureMap(EndpointId endpoint, AttributeValueEncoder & aEncoder);
};

constexpr uint16_t DescriptorAttrAccess::ClusterRevision;

CHIP_ERROR DescriptorAttrAccess::ReadFeatureMap(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
Clusters::Descriptor::Structs::SemanticTagStruct::Type tag;
Expand Down Expand Up @@ -202,7 +200,7 @@ CHIP_ERROR DescriptorAttrAccess::ReadClientServerAttribute(EndpointId endpoint,

CHIP_ERROR DescriptorAttrAccess::ReadClusterRevision(EndpointId endpoint, AttributeValueEncoder & aEncoder)
{
return aEncoder.Encode(ClusterRevision);
return aEncoder.Encode(kClusterRevision);
}

DescriptorAttrAccess gAttrAccess;
Expand Down
27 changes: 27 additions & 0 deletions src/app/clusters/descriptor/descriptor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2024 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.
*/

namespace chip {
namespace app {
namespace Clusters {
namespace Descriptor {

inline constexpr uint16_t kClusterRevision = 2;

} // namespace Descriptor
} // namespace Clusters
} // namespace app
} // namespace chip
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]

- 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]

- 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
2 changes: 1 addition & 1 deletion src/python_testing/TC_BOOLCFG_4_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def test_TC_BOOLCFG_4_4(self):
logging.info("Test step skipped")

self.step("5b")
if is_vis_feature_supported:
if is_aud_feature_supported:
enabledAlarms |= Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap.kAudible
else:
logging.info("Test step skipped")
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_BOOLCFG_5_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def test_TC_BOOLCFG_5_1(self):
logging.info("Test step skipped")

self.step("5b")
if is_vis_feature_supported:
if is_aud_feature_supported:
enabledAlarms |= Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap.kAudible
else:
logging.info("Test step skipped")
Expand Down Expand Up @@ -160,7 +160,7 @@ async def test_TC_BOOLCFG_5_1(self):
self.step("9b")
if not is_aud_feature_supported:
try:
await self.send_single_cmd(cmd=Clusters.Objects.BooleanStateConfiguration.Commands.SuppressAlarm(alarmsToSuppress=Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap.kVisual), endpoint=endpoint)
await self.send_single_cmd(cmd=Clusters.Objects.BooleanStateConfiguration.Commands.SuppressAlarm(alarmsToSuppress=Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap.kAudible), endpoint=endpoint)
asserts.fail("Received Success response when an CONSTRAINT_ERROR was expected")
except InteractionModelError as e:
asserts.assert_equal(e.status, Status.ConstraintError, "Unexpected error returned")
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_BOOLCFG_5_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def test_TC_BOOLCFG_5_2(self):
logging.info("Test step skipped")

self.step("5b")
if is_vis_feature_supported:
if is_aud_feature_supported:
enabledAlarms |= Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap.kAudible
else:
logging.info("Test step skipped")
Expand Down
Loading

0 comments on commit 282567d

Please sign in to comment.