Skip to content

Commit

Permalink
CChange struct field name from values -> presets
Browse files Browse the repository at this point in the history
  • Loading branch information
marktrayer committed Dec 13, 2024
1 parent 3b27586 commit 2342079
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Git: 1.4-267-gc3d95b5c9
<cluster code="0x0552"/>
<item fieldId="0" name="PresetID" type="int8u"/>
<item fieldId="1" name="Name" type="char_string" length="32"/>
<item fieldId="2" name="Values" type="MPTZStruct"/>
<item fieldId="2" name="Presets" type="MPTZStruct"/>
</struct>

<struct name="MPTZStruct" apiMaturity="provisional">
Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9859,7 +9859,7 @@ provisional cluster CameraAvSettingsUserLevelManagement = 1362 {
struct MPTZPresetStruct {
int8u presetID = 0;
char_string<32> name = 1;
MPTZStruct values = 2;
MPTZStruct presets = 2;
}

struct ViewportStruct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14181,26 +14181,26 @@ public String toString() {
public static class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {
public Integer presetID;
public String name;
public ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct values;
public ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct presets;
private static final long PRESET_ID_ID = 0L;
private static final long NAME_ID = 1L;
private static final long VALUES_ID = 2L;
private static final long PRESETS_ID = 2L;

public CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
Integer presetID,
String name,
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct values
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct presets
) {
this.presetID = presetID;
this.name = name;
this.values = values;
this.presets = presets;
}

public StructType encodeTlv() {
ArrayList<StructElement> values = new ArrayList<>();
values.add(new StructElement(PRESET_ID_ID, new UIntType(presetID)));
values.add(new StructElement(NAME_ID, new StringType(name)));
values.add(new StructElement(VALUES_ID, values.encodeTlv()));
values.add(new StructElement(PRESETS_ID, presets.encodeTlv()));

return new StructType(values);
}
Expand All @@ -14211,7 +14211,7 @@ public static CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct decodeT
}
Integer presetID = null;
String name = null;
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct values = null;
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct presets = null;
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == PRESET_ID_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
Expand All @@ -14223,17 +14223,17 @@ public static CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct decodeT
StringType castingValue = element.value(StringType.class);
name = castingValue.value(String.class);
}
} else if (element.contextTagNum() == VALUES_ID) {
} else if (element.contextTagNum() == PRESETS_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.Struct) {
StructType castingValue = element.value(StructType.class);
values = ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct.decodeTlv(castingValue);
presets = ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct.decodeTlv(castingValue);
}
}
}
return new CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
presetID,
name,
values
presets
);
}

Expand All @@ -14247,8 +14247,8 @@ public String toString() {
output.append("\tname: ");
output.append(name);
output.append("\n");
output.append("\tvalues: ");
output.append(values);
output.append("\tpresets: ");
output.append(presets);
output.append("\n");
output.append("}\n");
return output.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import matter.tlv.TlvWriter
class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
val presetID: UInt,
val name: String,
val values: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
val presets: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
) {
override fun toString(): String = buildString {
append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n")
append("\tpresetID : $presetID\n")
append("\tname : $name\n")
append("\tvalues : $values\n")
append("\tpresets : $presets\n")
append("}\n")
}

Expand All @@ -40,15 +40,15 @@ class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
startStructure(tlvTag)
put(ContextSpecificTag(TAG_PRESET_ID), presetID)
put(ContextSpecificTag(TAG_NAME), name)
values.toTlv(ContextSpecificTag(TAG_VALUES), this)
presets.toTlv(ContextSpecificTag(TAG_PRESETS), this)
endStructure()
}
}

companion object {
private const val TAG_PRESET_ID = 0
private const val TAG_NAME = 1
private const val TAG_VALUES = 2
private const val TAG_PRESETS = 2

fun fromTlv(
tlvTag: Tag,
Expand All @@ -57,15 +57,15 @@ class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
tlvReader.enterStructure(tlvTag)
val presetID = tlvReader.getUInt(ContextSpecificTag(TAG_PRESET_ID))
val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
val values =
val presets =
CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(
ContextSpecificTag(TAG_VALUES),
ContextSpecificTag(TAG_PRESETS),
tlvReader,
)

tlvReader.exitContainer()

return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, values)
return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, presets)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import matter.tlv.TlvWriter
class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
val presetID: UByte,
val name: String,
val values: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
val presets: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
) {
override fun toString(): String = buildString {
append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n")
append("\tpresetID : $presetID\n")
append("\tname : $name\n")
append("\tvalues : $values\n")
append("\tpresets : $presets\n")
append("}\n")
}

Expand All @@ -40,15 +40,15 @@ class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
startStructure(tlvTag)
put(ContextSpecificTag(TAG_PRESET_ID), presetID)
put(ContextSpecificTag(TAG_NAME), name)
values.toTlv(ContextSpecificTag(TAG_VALUES), this)
presets.toTlv(ContextSpecificTag(TAG_PRESETS), this)
endStructure()
}
}

companion object {
private const val TAG_PRESET_ID = 0
private const val TAG_NAME = 1
private const val TAG_VALUES = 2
private const val TAG_PRESETS = 2

fun fromTlv(
tlvTag: Tag,
Expand All @@ -57,15 +57,15 @@ class CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
tlvReader.enterStructure(tlvTag)
val presetID = tlvReader.getUByte(ContextSpecificTag(TAG_PRESET_ID))
val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
val values =
val presets =
CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(
ContextSpecificTag(TAG_VALUES),
ContextSpecificTag(TAG_PRESETS),
tlvReader,
)

tlvReader.exitContainer()

return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, values)
return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, presets)
}
}
}
80 changes: 40 additions & 40 deletions src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

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

4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Objects.py

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

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

2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h

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

Loading

0 comments on commit 2342079

Please sign in to comment.