Skip to content

Commit

Permalink
Rename of attribute to Settings to reflect the requested changes to t…
Browse files Browse the repository at this point in the history
…he matching Spec PR.
  • Loading branch information
marktrayer committed Dec 17, 2024
1 parent 2342079 commit 5572983
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="Presets" type="MPTZStruct"/>
<item fieldId="2" name="Settings" 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 presets = 2;
MPTZStruct settings = 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 presets;
public ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct settings;
private static final long PRESET_ID_ID = 0L;
private static final long NAME_ID = 1L;
private static final long PRESETS_ID = 2L;
private static final long SETTINGS_ID = 2L;

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

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(PRESETS_ID, presets.encodeTlv()));
values.add(new StructElement(SETTINGS_ID, settings.encodeTlv()));

return new StructType(values);
}
Expand All @@ -14211,7 +14211,7 @@ public static CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct decodeT
}
Integer presetID = null;
String name = null;
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct presets = null;
ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct settings = 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() == PRESETS_ID) {
} else if (element.contextTagNum() == SETTINGS_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.Struct) {
StructType castingValue = element.value(StructType.class);
presets = ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct.decodeTlv(castingValue);
settings = ChipStructs.CameraAvSettingsUserLevelManagementClusterMPTZStruct.decodeTlv(castingValue);
}
}
}
return new CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(
presetID,
name,
presets
settings
);
}

Expand All @@ -14247,8 +14247,8 @@ public String toString() {
output.append("\tname: ");
output.append(name);
output.append("\n");
output.append("\tpresets: ");
output.append(presets);
output.append("\tsettings: ");
output.append(settings);
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 presets: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
val settings: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
) {
override fun toString(): String = buildString {
append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n")
append("\tpresetID : $presetID\n")
append("\tname : $name\n")
append("\tpresets : $presets\n")
append("\tsettings : $settings\n")
append("}\n")
}

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

companion object {
private const val TAG_PRESET_ID = 0
private const val TAG_NAME = 1
private const val TAG_PRESETS = 2
private const val TAG_SETTINGS = 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 presets =
val settings =
CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(
ContextSpecificTag(TAG_PRESETS),
ContextSpecificTag(TAG_SETTINGS),
tlvReader,
)

tlvReader.exitContainer()

return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, presets)
return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, settings)
}
}
}
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 presets: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
val settings: CameraAvSettingsUserLevelManagementClusterMPTZStruct,
) {
override fun toString(): String = buildString {
append("CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct {\n")
append("\tpresetID : $presetID\n")
append("\tname : $name\n")
append("\tpresets : $presets\n")
append("\tsettings : $settings\n")
append("}\n")
}

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

companion object {
private const val TAG_PRESET_ID = 0
private const val TAG_NAME = 1
private const val TAG_PRESETS = 2
private const val TAG_SETTINGS = 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 presets =
val settings =
CameraAvSettingsUserLevelManagementClusterMPTZStruct.fromTlv(
ContextSpecificTag(TAG_PRESETS),
ContextSpecificTag(TAG_SETTINGS),
tlvReader,
)

tlvReader.exitContainer()

return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, presets)
return CameraAvSettingsUserLevelManagementClusterMPTZPresetStruct(presetID, name, settings)
}
}
}
81 changes: 41 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 5572983

Please sign in to comment.