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

Refactored yaml tests for Test_TC_S_2_1..4 #26459

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c32adb8
Resolving conflicts to rebase onto master
lpbeliveau-silabs May 5, 2023
5e57c51
Reverted files creating problems
lpbeliveau-silabs May 10, 2023
038a1aa
Added manual configuration options for AC and now getting the capacit…
lpbeliveau-silabs May 11, 2023
256a5e9
Reverted or condition on StoreScene test allowing INSUFFICIENT SPACE,…
lpbeliveau-silabs May 12, 2023
305498c
Restyled by whitespace
restyled-commits May 12, 2023
7b9ffcc
Restyled by prettier-yaml
restyled-commits May 12, 2023
68e1ac5
Added anyOf to check wether 0x00 or 0x89 was returned for store scene…
lpbeliveau-silabs May 16, 2023
23b0bff
Restyled by whitespace
restyled-commits May 16, 2023
a8de56a
Restyled by prettier-yaml
restyled-commits May 16, 2023
ab19881
Reverted runIf, anyOf and UnsignedNumberEquals commands for now until…
lpbeliveau-silabs May 18, 2023
7347b4b
Resolved conflicts for : Modified AttribueValue in Scenes::AttributeV…
lpbeliveau-silabs May 18, 2023
804b7ce
Restyled by prettier-yaml
restyled-commits May 18, 2023
e4d2bc1
Refactored tests and SceneTable default handlers to the uint32_t type…
lpbeliveau-silabs May 19, 2023
e865c53
Regenerated zap files for all-cluster apps
lpbeliveau-silabs May 19, 2023
f95c4d0
Regenerated zap files for chip-tool
lpbeliveau-silabs May 19, 2023
938dfcc
Applied corrections to 2_4 to follo test plan
lpbeliveau-silabs May 19, 2023
145f0fd
Restyled by whitespace
restyled-commits May 19, 2023
e803489
Restyled by prettier-yaml
restyled-commits May 19, 2023
a392544
Apply suggestions from code review
lpbeliveau-silabs May 25, 2023
b147ab4
Added missing checks, modified wrong description to match test plan
lpbeliveau-silabs May 25, 2023
057d1fa
Restyled by whitespace
restyled-commits May 25, 2023
f571c40
Restyled by prettier-yaml
restyled-commits May 25, 2023
aeee2e7
Regenerated after rebase
lpbeliveau-silabs May 25, 2023
6102b10
Added variable for G1 in Test_TC_s_2_3, changed GroupKeySecurityPoloc…
lpbeliveau-silabs May 26, 2023
82f6f1b
Applied restyler
lpbeliveau-silabs May 26, 2023
70840e4
Restyled by prettier-yaml
restyled-commits May 26, 2023
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 @@ -138,7 +138,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand All @@ -151,6 +151,9 @@ server cluster Scenes = 5 {
readonly attribute group_id currentGroup = 2;
readonly attribute boolean sceneValid = 3;
readonly attribute bitmap8 nameSupport = 4;
readonly attribute nullable node_id lastConfiguredBy = 5;
readonly attribute int16u sceneTableSize = 6;
readonly attribute int8u remainingCapacity = 7;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -5020,6 +5023,9 @@ endpoint 1 {
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport;
ram attribute lastConfiguredBy;
ram attribute sceneTableSize;
ram attribute remainingCapacity;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
}
Expand Down
60 changes: 54 additions & 6 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -9532,6 +9532,54 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "LastConfiguredBy",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "node_id",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "SceneTableSize",
"code": 6,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "RemainingCapacity",
"code": 7,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand All @@ -145,6 +145,9 @@ server cluster Scenes = 5 {
readonly attribute group_id currentGroup = 2;
readonly attribute boolean sceneValid = 3;
readonly attribute bitmap8 nameSupport = 4;
readonly attribute nullable node_id lastConfiguredBy = 5;
readonly attribute int16u sceneTableSize = 6;
readonly attribute int8u remainingCapacity = 7;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -4171,6 +4174,9 @@ endpoint 1 {
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport;
ram attribute lastConfiguredBy;
ram attribute sceneTableSize;
ram attribute remainingCapacity;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9003,6 +9003,54 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "LastConfiguredBy",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "node_id",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "SceneTableSize",
"code": 6,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "RemainingCapacity",
"code": 7,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand Down Expand Up @@ -24952,5 +25000,6 @@
"endpointVersion": 1,
"deviceIdentifier": 61442
}
]
],
"log": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ client cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand All @@ -200,6 +200,8 @@ client cluster Scenes = 5 {
readonly attribute boolean sceneValid = 3;
readonly attribute bitmap8 nameSupport = 4;
readonly attribute optional nullable node_id lastConfiguredBy = 5;
readonly attribute int16u sceneTableSize = 6;
readonly attribute int8u remainingCapacity = 7;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down
2 changes: 1 addition & 1 deletion examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand Down
2 changes: 1 addition & 1 deletion examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ server cluster Scenes = 5 {

struct AttributeValuePair {
optional attrib_id attributeID = 0;
int8u attributeValue[] = 1;
int32u attributeValue = 1;
}

struct ExtensionFieldSet {
Expand Down
44 changes: 6 additions & 38 deletions src/app/clusters/scenes/SceneTableImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,9 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler
auto pair_iterator = extensionFieldSet.attributeValueList.begin();
while (pair_iterator.Next())
{
aVPair = pair_iterator.GetValue();
mAVPairs[pairCount].attributeID = aVPair.attributeID;
size_t valueBytesTotal = 0;
uint8_t valueBytesCount = 0;

ReturnErrorOnFailure(aVPair.attributeValue.ComputeSize(&valueBytesTotal));
VerifyOrReturnError(valueBytesTotal <= ArraySize(mValueBuffer[0]), CHIP_ERROR_BUFFER_TOO_SMALL);

auto value_iterator = aVPair.attributeValue.begin();
while (value_iterator.Next())
{
mValueBuffer[pairCount][valueBytesCount] = value_iterator.GetValue();
valueBytesCount++;
}
ReturnErrorOnFailure(value_iterator.GetStatus());

mAVPairs[pairCount].attributeValue = mValueBuffer[pairCount];
mAVPairs[pairCount].attributeValue.reduce_size(valueBytesCount);
aVPair = pair_iterator.GetValue();
mAVPairs[pairCount].attributeID = aVPair.attributeID;
mAVPairs[pairCount].attributeValue = aVPair.attributeValue;
pairCount++;
}
ReturnErrorOnFailure(pair_iterator.GetStatus());
Expand Down Expand Up @@ -132,25 +117,9 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler
auto pair_iterator = attributeValueList.begin();
while (pair_iterator.Next())
{
decodePair = pair_iterator.GetValue();
mAVPairs[pairCount].attributeID = decodePair.attributeID;
size_t valueBytesTotal = 0;
uint8_t valueBytesCount = 0;

// Verify size of attribute value
ReturnErrorOnFailure(decodePair.attributeValue.ComputeSize(&valueBytesTotal));
VerifyOrReturnError(valueBytesTotal <= ArraySize(mValueBuffer[0]), CHIP_ERROR_BUFFER_TOO_SMALL);

auto value_iterator = decodePair.attributeValue.begin();
while (value_iterator.Next())
{
mValueBuffer[pairCount][valueBytesCount] = value_iterator.GetValue();
valueBytesCount++;
}
ReturnErrorOnFailure(value_iterator.GetStatus());

mAVPairs[pairCount].attributeValue = mValueBuffer[pairCount];
mAVPairs[pairCount].attributeValue.reduce_size(valueBytesCount);
decodePair = pair_iterator.GetValue();
mAVPairs[pairCount].attributeID = decodePair.attributeID;
mAVPairs[pairCount].attributeValue = decodePair.attributeValue;
pairCount++;
};
ReturnErrorOnFailure(pair_iterator.GetStatus());
Expand All @@ -164,7 +133,6 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler

private:
app::Clusters::Scenes::Structs::AttributeValuePair::Type mAVPairs[kMaxAvPair];
uint8_t mValueBuffer[kMaxAvPair][kMaxValueSize];
};

/**
Expand Down
Loading