Skip to content

Commit

Permalink
Generated using ./scripts/tools/zap_regen_all.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcosb authored and pidarped committed Oct 1, 2024
1 parent 560c1e1 commit 83159c2
Show file tree
Hide file tree
Showing 32 changed files with 167 additions and 169 deletions.
4 changes: 2 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9413,12 +9413,12 @@ provisional cluster Chime = 1366 {
revision 1;

struct ChimeSoundStruct {
int8u chimeId = 0;
int8u chimeID = 0;
char_string<48> name = 1;
}

readonly attribute ChimeSoundStruct installedChimeSounds[] = 0;
attribute int8u activeChimeSoundId = 1;
attribute int8u activeChimeID = 1;
attribute boolean enabled = 2;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59495,7 +59495,7 @@ public static class ChimeCluster extends BaseChipCluster {
public static final long CLUSTER_ID = 1366L;

private static final long INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID = 0L;
private static final long ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID = 1L;
private static final long ACTIVE_CHIME_ID_ATTRIBUTE_ID = 1L;
private static final long ENABLED_ATTRIBUTE_ID = 2L;
private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L;
private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L;
Expand Down Expand Up @@ -59576,39 +59576,39 @@ public void onSuccess(byte[] tlv) {
}, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, minInterval, maxInterval);
}

public void readActiveChimeSoundIdAttribute(
public void readActiveChimeIDAttribute(
IntegerAttributeCallback callback) {
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID);
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_ID_ATTRIBUTE_ID);

readAttribute(new ReportCallbackImpl(callback, path) {
@Override
public void onSuccess(byte[] tlv) {
Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
callback.onSuccess(value);
}
}, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, true);
}, ACTIVE_CHIME_ID_ATTRIBUTE_ID, true);
}

public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value) {
writeActiveChimeSoundIdAttribute(callback, value, 0);
public void writeActiveChimeIDAttribute(DefaultClusterCallback callback, Integer value) {
writeActiveChimeIDAttribute(callback, value, 0);
}

public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
public void writeActiveChimeIDAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
BaseTLVType tlvValue = new UIntType(value);
writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
}

public void subscribeActiveChimeSoundIdAttribute(
public void subscribeActiveChimeIDAttribute(
IntegerAttributeCallback callback, int minInterval, int maxInterval) {
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID);
ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_ID_ATTRIBUTE_ID);

subscribeAttribute(new ReportCallbackImpl(callback, path) {
@Override
public void onSuccess(byte[] tlv) {
Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
callback.onSuccess(value);
}
}, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, minInterval, maxInterval);
}, ACTIVE_CHIME_ID_ATTRIBUTE_ID, minInterval, maxInterval);
}

public void readEnabledAttribute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12725,22 +12725,22 @@ public String toString() {
}
}
public static class ChimeClusterChimeSoundStruct {
public Integer chimeId;
public Integer chimeID;
public String name;
private static final long CHIME_ID_ID = 0L;
private static final long NAME_ID = 1L;

public ChimeClusterChimeSoundStruct(
Integer chimeId,
Integer chimeID,
String name
) {
this.chimeId = chimeId;
this.chimeID = chimeID;
this.name = name;
}

public StructType encodeTlv() {
ArrayList<StructElement> values = new ArrayList<>();
values.add(new StructElement(CHIME_ID_ID, new UIntType(chimeId)));
values.add(new StructElement(CHIME_ID_ID, new UIntType(chimeID)));
values.add(new StructElement(NAME_ID, new StringType(name)));

return new StructType(values);
Expand All @@ -12750,13 +12750,13 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) {
if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
return null;
}
Integer chimeId = null;
Integer chimeID = null;
String name = null;
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == CHIME_ID_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
chimeId = castingValue.value(Integer.class);
chimeID = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == NAME_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.String) {
Expand All @@ -12766,7 +12766,7 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) {
}
}
return new ChimeClusterChimeSoundStruct(
chimeId,
chimeID,
name
);
}
Expand All @@ -12775,8 +12775,8 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) {
public String toString() {
StringBuilder output = new StringBuilder();
output.append("ChimeClusterChimeSoundStruct {\n");
output.append("\tchimeId: ");
output.append(chimeId);
output.append("\tchimeID: ");
output.append(chimeID);
output.append("\n");
output.append("\tname: ");
output.append(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16889,7 +16889,7 @@ public long getID() {

public enum Attribute {
InstalledChimeSounds(0L),
ActiveChimeSoundId(1L),
ActiveChimeID(1L),
Enabled(2L),
GeneratedCommandList(65528L),
AcceptedCommandList(65529L),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18248,17 +18248,17 @@ private static Map<String, InteractionInfo> readChimeInteractionInfo() {
readChimeInstalledChimeSoundsCommandParams
);
result.put("readInstalledChimeSoundsAttribute", readChimeInstalledChimeSoundsAttributeInteractionInfo);
Map<String, CommandParameterInfo> readChimeActiveChimeSoundIdCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo(
Map<String, CommandParameterInfo> readChimeActiveChimeIDCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readChimeActiveChimeIDAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.ChimeCluster) cluster).readActiveChimeSoundIdAttribute(
((ChipClusters.ChimeCluster) cluster).readActiveChimeIDAttribute(
(ChipClusters.IntegerAttributeCallback) callback
);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readChimeActiveChimeSoundIdCommandParams
readChimeActiveChimeIDCommandParams
);
result.put("readActiveChimeSoundIdAttribute", readChimeActiveChimeSoundIdAttributeInteractionInfo);
result.put("readActiveChimeIDAttribute", readChimeActiveChimeIDAttributeInteractionInfo);
Map<String, CommandParameterInfo> readChimeEnabledCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readChimeEnabledAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3473,28 +3473,28 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() {
Map<String, InteractionInfo> writeContentAppObserverInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo);
Map<String, InteractionInfo> writeChimeInteractionInfo = new LinkedHashMap<>();
Map<String, CommandParameterInfo> writeChimeActiveChimeSoundIdCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo chimeactiveChimeSoundIdCommandParameterInfo =
Map<String, CommandParameterInfo> writeChimeActiveChimeIDCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo chimeactiveChimeIDCommandParameterInfo =
new CommandParameterInfo(
"value",
Integer.class,
Integer.class
);
writeChimeActiveChimeSoundIdCommandParams.put(
writeChimeActiveChimeIDCommandParams.put(
"value",
chimeactiveChimeSoundIdCommandParameterInfo
chimeactiveChimeIDCommandParameterInfo
);
InteractionInfo writeChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo(
InteractionInfo writeChimeActiveChimeIDAttributeInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.ChimeCluster) cluster).writeActiveChimeSoundIdAttribute(
((ChipClusters.ChimeCluster) cluster).writeActiveChimeIDAttribute(
(DefaultClusterCallback) callback,
(Integer) commandArguments.get("value")
);
},
() -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
writeChimeActiveChimeSoundIdCommandParams
writeChimeActiveChimeIDCommandParams
);
writeChimeInteractionInfo.put("writeActiveChimeSoundIdAttribute", writeChimeActiveChimeSoundIdAttributeInteractionInfo);
writeChimeInteractionInfo.put("writeActiveChimeIDAttribute", writeChimeActiveChimeIDAttributeInteractionInfo);
Map<String, CommandParameterInfo> writeChimeEnabledCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
CommandParameterInfo chimeenabledCommandParameterInfo =
new CommandParameterInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) {
class ChimeClusterChimeSoundStruct(val chimeID: UInt, val name: String) {
override fun toString(): String = buildString {
append("ChimeClusterChimeSoundStruct {\n")
append("\tchimeId : $chimeId\n")
append("\tchimeID : $chimeID\n")
append("\tname : $name\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CHIME_ID), chimeId)
put(ContextSpecificTag(TAG_CHIME_ID), chimeID)
put(ContextSpecificTag(TAG_NAME), name)
endStructure()
}
Expand All @@ -45,12 +45,12 @@ class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) {

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct {
tlvReader.enterStructure(tlvTag)
val chimeId = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID))
val chimeID = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID))
val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))

tlvReader.exitContainer()

return ChimeClusterChimeSoundStruct(chimeId, name)
return ChimeClusterChimeSoundStruct(chimeID, name)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin
}
}

suspend fun readActiveChimeSoundIdAttribute(): UByte {
suspend fun readActiveChimeIDAttribute(): UByte {
val ATTRIBUTE_ID: UInt = 1u

val attributePath =
Expand All @@ -232,7 +232,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin
it.path.attributeId == ATTRIBUTE_ID
}

requireNotNull(attributeData) { "Activechimesoundid attribute not found in response" }
requireNotNull(attributeData) { "Activechimeid attribute not found in response" }

// Decode the TLV data into the appropriate type
val tlvReader = TlvReader(attributeData.data)
Expand All @@ -241,7 +241,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin
return decodedValue
}

suspend fun writeActiveChimeSoundIdAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
suspend fun writeActiveChimeIDAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
val ATTRIBUTE_ID: UInt = 1u

val tlvWriter = TlvWriter()
Expand Down Expand Up @@ -281,7 +281,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin
}
}

suspend fun subscribeActiveChimeSoundIdAttribute(
suspend fun subscribeActiveChimeIDAttribute(
minInterval: Int,
maxInterval: Int,
): Flow<UByteSubscriptionState> {
Expand Down Expand Up @@ -316,9 +316,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin
.filterIsInstance<ReadData.Attribute>()
.firstOrNull { it.path.attributeId == ATTRIBUTE_ID }

requireNotNull(attributeData) {
"Activechimesoundid attribute not found in Node State update"
}
requireNotNull(attributeData) { "Activechimeid attribute not found in Node State update" }

// Decode the TLV data into the appropriate type
val tlvReader = TlvReader(attributeData.data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ import matter.tlv.Tag
import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) {
class ChimeClusterChimeSoundStruct(val chimeID: UByte, val name: String) {
override fun toString(): String = buildString {
append("ChimeClusterChimeSoundStruct {\n")
append("\tchimeId : $chimeId\n")
append("\tchimeID : $chimeID\n")
append("\tname : $name\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_CHIME_ID), chimeId)
put(ContextSpecificTag(TAG_CHIME_ID), chimeID)
put(ContextSpecificTag(TAG_NAME), name)
endStructure()
}
Expand All @@ -45,12 +45,12 @@ class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) {

fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct {
tlvReader.enterStructure(tlvTag)
val chimeId = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID))
val chimeID = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID))
val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))

tlvReader.exitContainer()

return ChimeClusterChimeSoundStruct(chimeId, name)
return ChimeClusterChimeSoundStruct(chimeID, name)
}
}
}
20 changes: 10 additions & 10 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.

2 changes: 1 addition & 1 deletion src/controller/python/chip/clusters/CHIPClusters.py

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

Loading

0 comments on commit 83159c2

Please sign in to comment.