Skip to content

Commit

Permalink
Regenerated Darwin framework commands for new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Nov 14, 2023
1 parent 0af9276 commit c22830e
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 72 deletions.
4 changes: 3 additions & 1 deletion examples/darwin-framework-tool/templates/tests/ciTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"Test_TC_FLW_2_1",
"Test_TC_RH_2_1",
"Disabled because darwin-framework-tool does not handle substraction in parameters",
"Test_TC_S_2_3"
"Test_TC_S_2_3",
"TestScenesMultiFabric",
"TestScenesFabricSceneInfo"
]
}
9 changes: 8 additions & 1 deletion src/app/tests/suites/TestScenesFabricSceneInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ tests:
- name: "nodeId"
value: nodeId

- label: "TH1 reads the fabric index"
cluster: "Operational Credentials"
endpoint: 0
command: "readAttribute"
attribute: "CurrentFabricIndex"
response:
saveAs: th1FabricIndex

- label: "Read FeatureMap FabricScene bit (global attribute 65532)"
command: "readAttribute"
attribute: "FeatureMap"
Expand Down Expand Up @@ -141,7 +149,6 @@ tests:

- label: "TH sends a RemoveAllGroups command to DUT."
cluster: "Groups"
endpoint: endpoint
command: "RemoveAllGroups"

- label: "TH sends a AddGroup command to DUT for G1."
Expand Down
1 change: 0 additions & 1 deletion src/app/tests/suites/TestScenesMultiFabric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ tests:

- label: "TH1 sends a RemoveAllGroups command to DUT."
cluster: "Groups"
endpoint: endpoint
command: "RemoveAllGroups"

- label: "TH1 sends a AddGroup command to DUT for G1."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ public static class ScenesCluster extends BaseChipCluster {
private static final long NAME_SUPPORT_ATTRIBUTE_ID = 4L;
private static final long LAST_CONFIGURED_BY_ATTRIBUTE_ID = 5L;
private static final long SCENE_TABLE_SIZE_ATTRIBUTE_ID = 6L;
private static final long REMAINING_CAPACITY_ATTRIBUTE_ID = 7L;
private static final long FABRIC_SCENE_INFO_ATTRIBUTE_ID = 7L;
private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L;
private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L;
private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L;
Expand Down Expand Up @@ -1600,13 +1600,11 @@ public interface LastConfiguredByAttributeCallback extends BaseAttributeCallback
void onSuccess(@Nullable Long value);
}

public interface FabricSceneInfoAttributeCallback {
public interface FabricSceneInfoAttributeCallback extends BaseAttributeCallback {
void onSuccess(List<ChipStructs.ScenesClusterSceneInfoStruct> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface GeneratedCommandListAttributeCallback {
public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
void onSuccess(List<Long> value);
}

Expand Down Expand Up @@ -1799,18 +1797,32 @@ public void onSuccess(byte[] tlv) {

public void readFabricSceneInfoAttribute(
FabricSceneInfoAttributeCallback callback) {
readFabricSceneInfoAttribute(chipClusterPtr, callback, true);
readFabricSceneInfoAttributeWithFabricFilter(callback, true);
}

public void readFabricSceneInfoAttributeWithFabricFilter(
FabricSceneInfoAttributeCallback callback, boolean isFabricFiltered) {
readFabricSceneInfoAttribute(chipClusterPtr, callback, isFabricFiltered);
}
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRIC_SCENE_INFO_ATTRIBUTE_ID);

readAttribute(new ReportCallbackImpl(callback, path) {
@Override
public void onSuccess(byte[] tlv) {
List<ChipStructs.ScenesClusterSceneInfoStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
callback.onSuccess(value);
}
}, FABRIC_SCENE_INFO_ATTRIBUTE_ID, isFabricFiltered);
}

public void subscribeFabricSceneInfoAttribute(
FabricSceneInfoAttributeCallback callback, int minInterval, int maxInterval) {
subscribeFabricSceneInfoAttribute(chipClusterPtr, callback, minInterval, maxInterval);
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRIC_SCENE_INFO_ATTRIBUTE_ID);

subscribeAttribute(new ReportCallbackImpl(callback, path) {
@Override
public void onSuccess(byte[] tlv) {
List<ChipStructs.ScenesClusterSceneInfoStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
}
}, FABRIC_SCENE_INFO_ATTRIBUTE_ID, minInterval, maxInterval);
}

public void readGeneratedCommandListAttribute(
Expand Down Expand Up @@ -1962,62 +1974,6 @@ public void onSuccess(byte[] tlv) {
}
}, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval);
}

private native void readSceneCountAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeSceneCountAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readCurrentSceneAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeCurrentSceneAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readCurrentGroupAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeCurrentGroupAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readSceneValidAttribute(long chipClusterPtr, BooleanAttributeCallback callback);

private native void subscribeSceneValidAttribute(long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval);

private native void readNameSupportAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeNameSupportAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readLastConfiguredByAttribute(long chipClusterPtr, LastConfiguredByAttributeCallback callback);

private native void subscribeLastConfiguredByAttribute(long chipClusterPtr, LastConfiguredByAttributeCallback callback, int minInterval, int maxInterval);

private native void readSceneTableSizeAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeSceneTableSizeAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readFabricSceneInfoAttribute(long chipClusterPtr, FabricSceneInfoAttributeCallback callback, boolean isFabricFiltered);

private native void subscribeFabricSceneInfoAttribute(long chipClusterPtr, FabricSceneInfoAttributeCallback callback, int minInterval, int maxInterval);

private native void readGeneratedCommandListAttribute(long chipClusterPtr, GeneratedCommandListAttributeCallback callback);

private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval);

private native void readAcceptedCommandListAttribute(long chipClusterPtr, AcceptedCommandListAttributeCallback callback);

private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval);

private native void readEventListAttribute(long chipClusterPtr, EventListAttributeCallback callback);

private native void subscribeEventListAttribute(long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval);

private native void readAttributeListAttribute(long chipClusterPtr, AttributeListAttributeCallback callback);

private native void subscribeAttributeListAttribute(long chipClusterPtr, AttributeListAttributeCallback callback, int minInterval, int maxInterval);

private native void readFeatureMapAttribute(long chipClusterPtr, LongAttributeCallback callback);

private native void subscribeFeatureMapAttribute(long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval);

private native void readClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
}

public static class OnOffCluster extends BaseChipCluster {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ public static class ScenesClusterSceneInfoStruct {
public Boolean sceneValid;
public Integer remainingCapacity;
public Integer fabricIndex;
private static final long SCENE_COUNT_ID = 0L;
private static final long CURRENT_SCENE_ID = 1L;
private static final long CURRENT_GROUP_ID = 2L;
private static final long SCENE_VALID_ID = 3L;
private static final long REMAINING_CAPACITY_ID = 4L;
private static final long FABRIC_INDEX_ID = 254L;

public ScenesClusterSceneInfoStruct(
Integer sceneCount,
Integer currentScene,
Expand All @@ -169,6 +176,71 @@ public ScenesClusterSceneInfoStruct(
this.fabricIndex = fabricIndex;
}

public StructType encodeTlv() {
ArrayList<StructElement> values = new ArrayList<>();
values.add(new StructElement(SCENE_COUNT_ID, new UIntType(sceneCount)));
values.add(new StructElement(CURRENT_SCENE_ID, new UIntType(currentScene)));
values.add(new StructElement(CURRENT_GROUP_ID, new UIntType(currentGroup)));
values.add(new StructElement(SCENE_VALID_ID, new BooleanType(sceneValid)));
values.add(new StructElement(REMAINING_CAPACITY_ID, new UIntType(remainingCapacity)));
values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex)));

return new StructType(values);
}

public static ScenesClusterSceneInfoStruct decodeTlv(BaseTLVType tlvValue) {
if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
return null;
}
Integer sceneCount = null;
Integer currentScene = null;
Integer currentGroup = null;
Boolean sceneValid = null;
Integer remainingCapacity = null;
Integer fabricIndex = null;
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == SCENE_COUNT_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
sceneCount = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == CURRENT_SCENE_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
currentScene = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == CURRENT_GROUP_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
currentGroup = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == SCENE_VALID_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.Boolean) {
BooleanType castingValue = element.value(BooleanType.class);
sceneValid = castingValue.value(Boolean.class);
}
} else if (element.contextTagNum() == REMAINING_CAPACITY_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
remainingCapacity = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == FABRIC_INDEX_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
fabricIndex = castingValue.value(Integer.class);
}
}
}
return new ScenesClusterSceneInfoStruct(
sceneCount,
currentScene,
currentGroup,
sceneValid,
remainingCapacity,
fabricIndex
);
}

@Override
public String toString() {
StringBuilder output = new StringBuilder();
Expand Down
3 changes: 0 additions & 3 deletions src/darwin/Framework/CHIP/templates/availability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7799,12 +7799,10 @@
AdministratorCommissioning:
Feature:
- Basic
<<<<<<< HEAD
ContentLauncher:
SupportedProtocolsBitmap:
- DASH
- HLS
=======
attributes:
Scenes:
- FabricSceneInfo
Expand All @@ -7813,7 +7811,6 @@
Scenes:
- SceneInfoStruct
# Targeting Spring 2024 Matter release
>>>>>>> 31997b48fa (Applied suggestions in review and created FabricSceneIndo yaml test, still needs Multi fabric testing)
deprecated:
event fields:
WiFiNetworkDiagnostics:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c22830e

Please sign in to comment.