Generated using ./alchemy zap --attribute="in-progress" ... Chime.adoc
diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md
index 4167914..94fe851 100644
--- a/docs/zap_clusters.md
+++ b/docs/zap_clusters.md
@@ -129,6 +129,7 @@
| 1294 | 0x50E | AccountLogin |
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
+| 1366 | 0x556 | Chime |
| 1872 | 0x750 | EcosystemInformation |
| 1873 | 0x751 | CommissionerControl |
| 4294048773 | 0xFFF1FC05 | UnitTesting |
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 6c7748e..9502c37 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -9408,6 +9408,28 @@
command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0;
}
+/** */
+cluster Chime = 1366 {
+ revision 1;
+
+ struct ChimeSoundStruct {
+ int8u chimeId = 0;
+ char_string<48> name = 1;
+ }
+
+ readonly attribute ChimeSoundStruct installedChimeSounds[] = 0;
+ attribute int8u activeChimeSoundId = 1;
+ attribute boolean enabled = 2;
+ readonly attribute command_id generatedCommandList[] = 65528;
+ readonly attribute command_id acceptedCommandList[] = 65529;
+ readonly attribute event_id eventList[] = 65530;
+ readonly attribute attrib_id attributeList[] = 65531;
+ readonly attribute bitmap32 featureMap = 65532;
+ readonly attribute int16u clusterRevision = 65533;
+
+ command PlayChimeSound(): DefaultSuccess = 0;
+}
+
/** Provides extended device information for all the logical devices represented by a Bridged Node. */
provisional cluster EcosystemInformation = 1872 {
revision 1;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
index bb92218..c8e56ac 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -59491,6 +59491,318 @@
}
}
+ 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 ENABLED_ATTRIBUTE_ID = 2L;
+ 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;
+ private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L;
+ private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L;
+ private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L;
+
+ public ChimeCluster(long devicePtr, int endpointId) {
+ super(devicePtr, endpointId, CLUSTER_ID);
+ }
+
+ @Override
+ @Deprecated
+ public long initWithDevice(long devicePtr, int endpointId) {
+ return 0L;
+ }
+
+ public void playChimeSound(DefaultClusterCallback callback) {
+ playChimeSound(callback, 0);
+ }
+
+ public void playChimeSound(DefaultClusterCallback callback, int timedInvokeTimeoutMs) {
+ final long commandId = 0L;
+
+ ArrayList<StructElement> elements = new ArrayList<>();
+ StructType commandArgs = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ callback.onSuccess();
+ }}, commandId, commandArgs, timedInvokeTimeoutMs);
+ }
+
+ public interface InstalledChimeSoundsAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List<ChipStructs.ChimeClusterChimeSoundStruct> value);
+ }
+
+ public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List<Long> value);
+ }
+
+ public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List<Long> value);
+ }
+
+ public interface EventListAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List<Long> value);
+ }
+
+ public interface AttributeListAttributeCallback extends BaseAttributeCallback {
+ void onSuccess(List<Long> value);
+ }
+
+ public void readInstalledChimeSoundsAttribute(
+ InstalledChimeSoundsAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<ChipStructs.ChimeClusterChimeSoundStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeInstalledChimeSoundsAttribute(
+ InstalledChimeSoundsAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<ChipStructs.ChimeClusterChimeSoundStruct> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readActiveChimeSoundIdAttribute(
+ IntegerAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_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);
+ }
+
+ public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value) {
+ writeActiveChimeSoundIdAttribute(callback, value, 0);
+ }
+
+ public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = new UIntType(value);
+ writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeActiveChimeSoundIdAttribute(
+ IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_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);
+ }
+
+ public void readEnabledAttribute(
+ BooleanAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ENABLED_ATTRIBUTE_ID, true);
+ }
+
+ public void writeEnabledAttribute(DefaultClusterCallback callback, Boolean value) {
+ writeEnabledAttribute(callback, value, 0);
+ }
+
+ public void writeEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) {
+ BaseTLVType tlvValue = new BooleanType(value);
+ writeAttribute(new WriteAttributesCallbackImpl(callback), ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs);
+ }
+
+ public void subscribeEnabledAttribute(
+ BooleanAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ENABLED_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readGeneratedCommandListAttribute(
+ GeneratedCommandListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeGeneratedCommandListAttribute(
+ GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readAcceptedCommandListAttribute(
+ AcceptedCommandListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeAcceptedCommandListAttribute(
+ AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readEventListAttribute(
+ EventListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, EVENT_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeEventListAttribute(
+ EventListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readAttributeListAttribute(
+ AttributeListAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeAttributeListAttribute(
+ AttributeListAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ List<Long> value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readFeatureMapAttribute(
+ LongAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, FEATURE_MAP_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeFeatureMapAttribute(
+ LongAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+
+ public void readClusterRevisionAttribute(
+ IntegerAttributeCallback callback) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID);
+
+ readAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, CLUSTER_REVISION_ATTRIBUTE_ID, true);
+ }
+
+ public void subscribeClusterRevisionAttribute(
+ IntegerAttributeCallback callback, int minInterval, int maxInterval) {
+ ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID);
+
+ subscribeAttribute(new ReportCallbackImpl(callback, path) {
+ @Override
+ public void onSuccess(byte[] tlv) {
+ Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv);
+ callback.onSuccess(value);
+ }
+ }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval);
+ }
+ }
+
public static class EcosystemInformationCluster extends BaseChipCluster {
public static final long CLUSTER_ID = 1872L;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
index 7ee8a88..ad16b07 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java
@@ -12724,6 +12724,67 @@
return output.toString();
}
}
+public static class ChimeClusterChimeSoundStruct {
+ 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,
+ String name
+ ) {
+ 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(NAME_ID, new StringType(name)));
+
+ return new StructType(values);
+ }
+
+ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) {
+ if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
+ return 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);
+ }
+ } else if (element.contextTagNum() == NAME_ID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.String) {
+ StringType castingValue = element.value(StringType.class);
+ name = castingValue.value(String.class);
+ }
+ }
+ }
+ return new ChimeClusterChimeSoundStruct(
+ chimeId,
+ name
+ );
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("ChimeClusterChimeSoundStruct {\n");
+ output.append("\tchimeId: ");
+ output.append(chimeId);
+ output.append("\n");
+ output.append("\tname: ");
+ output.append(name);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+}
public static class EcosystemInformationClusterDeviceTypeStruct {
public Long deviceType;
public Integer revision;
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index 8bf4e6d..fb20707 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -379,6 +379,9 @@
if (clusterId == ContentAppObserver.ID) {
return new ContentAppObserver();
}
+ if (clusterId == Chime.ID) {
+ return new Chime();
+ }
if (clusterId == EcosystemInformation.ID) {
return new EcosystemInformation();
}
@@ -16878,6 +16881,110 @@
return Command.valueOf(name).getID();
}
}
+ public static class Chime implements BaseCluster {
+ public static final long ID = 1366L;
+ public long getID() {
+ return ID;
+ }
+
+ public enum Attribute {
+ InstalledChimeSounds(0L),
+ ActiveChimeSoundId(1L),
+ Enabled(2L),
+ GeneratedCommandList(65528L),
+ AcceptedCommandList(65529L),
+ EventList(65530L),
+ AttributeList(65531L),
+ FeatureMap(65532L),
+ ClusterRevision(65533L),;
+ private final long id;
+ Attribute(long id) {
+ this.id = id;
+ }
+
+ public long getID() {
+ return id;
+ }
+
+ public static Attribute value(long id) throws NoSuchFieldError {
+ for (Attribute attribute : Attribute.values()) {
+ if (attribute.getID() == id) {
+ return attribute;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }
+
+ public enum Event {;
+ private final long id;
+ Event(long id) {
+ this.id = id;
+ }
+
+ public long getID() {
+ return id;
+ }
+
+ public static Event value(long id) throws NoSuchFieldError {
+ for (Event event : Event.values()) {
+ if (event.getID() == id) {
+ return event;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }
+
+ public enum Command {
+ PlayChimeSound(0L),;
+ private final long id;
+ Command(long id) {
+ this.id = id;
+ }
+
+ public long getID() {
+ return id;
+ }
+
+ public static Command value(long id) throws NoSuchFieldError {
+ for (Command command : Command.values()) {
+ if (command.getID() == id) {
+ return command;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }@Override
+ public String getAttributeName(long id) throws NoSuchFieldError {
+ return Attribute.value(id).toString();
+ }
+
+ @Override
+ public String getEventName(long id) throws NoSuchFieldError {
+ return Event.value(id).toString();
+ }
+
+ @Override
+ public String getCommandName(long id) throws NoSuchFieldError {
+ return Command.value(id).toString();
+ }
+
+ @Override
+ public long getAttributeID(String name) throws IllegalArgumentException {
+ return Attribute.valueOf(name).getID();
+ }
+
+ @Override
+ public long getEventID(String name) throws IllegalArgumentException {
+ return Event.valueOf(name).getID();
+ }
+
+ @Override
+ public long getCommandID(String name) throws IllegalArgumentException {
+ return Command.valueOf(name).getID();
+ }
+ }
public static class EcosystemInformation implements BaseCluster {
public static final long ID = 1872L;
public long getID() {
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
index d10ce6b..3025c26 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -19994,6 +19994,111 @@
}
}
+ public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List<ChipStructs.ChimeClusterChimeSoundStruct> valueList) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<ChipStructs.ChimeClusterChimeSoundStruct>");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+ public static class DelegatedChimeClusterGeneratedCommandListAttributeCallback implements ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List<Long> valueList) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+ public static class DelegatedChimeClusterAcceptedCommandListAttributeCallback implements ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List<Long> valueList) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+ public static class DelegatedChimeClusterEventListAttributeCallback implements ChipClusters.ChimeCluster.EventListAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List<Long> valueList) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
+ public static class DelegatedChimeClusterAttributeListAttributeCallback implements ChipClusters.ChimeCluster.AttributeListAttributeCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(List<Long> valueList) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+ CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List<Long>");
+ responseValues.put(commandResponseInfo, valueList);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ callback.onFailure(ex);
+ }
+ }
+
public static class DelegatedEcosystemInformationClusterDeviceDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.DeviceDirectoryAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -22330,6 +22435,10 @@
(ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>());
clusterMap.put("contentAppObserver", contentAppObserverClusterInfo);
+ ClusterInfo chimeClusterInfo = new ClusterInfo(
+ (ptr, endpointId) -> new ChipClusters.ChimeCluster(ptr, endpointId), new HashMap<>());
+ clusterMap.put("chime", chimeClusterInfo);
+
ClusterInfo ecosystemInformationClusterInfo = new ClusterInfo(
(ptr, endpointId) -> new ChipClusters.EcosystemInformationCluster(ptr, endpointId), new HashMap<>());
clusterMap.put("ecosystemInformation", ecosystemInformationClusterInfo);
@@ -22471,6 +22580,7 @@
destination.get("accountLogin").combineCommands(source.get("accountLogin"));
destination.get("contentControl").combineCommands(source.get("contentControl"));
destination.get("contentAppObserver").combineCommands(source.get("contentAppObserver"));
+ destination.get("chime").combineCommands(source.get("chime"));
destination.get("ecosystemInformation").combineCommands(source.get("ecosystemInformation"));
destination.get("commissionerControl").combineCommands(source.get("commissionerControl"));
destination.get("unitTesting").combineCommands(source.get("unitTesting"));
@@ -28629,6 +28739,22 @@
commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap);
+ Map<String, InteractionInfo> chimeClusterInteractionInfoMap = new LinkedHashMap<>();
+
+ Map<String, CommandParameterInfo> chimeplayChimeSoundCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo chimeplayChimeSoundInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster)
+ .playChimeSound((DefaultClusterCallback) callback
+ );
+ },
+ () -> new DelegatedDefaultClusterCallback(),
+ chimeplayChimeSoundCommandParams
+ );
+ chimeClusterInteractionInfoMap.put("playChimeSound", chimeplayChimeSoundInteractionInfo);
+
+ commandMap.put("chime", chimeClusterInteractionInfoMap);
+
Map<String, InteractionInfo> ecosystemInformationClusterInteractionInfoMap = new LinkedHashMap<>();
commandMap.put("ecosystemInformation", ecosystemInformationClusterInteractionInfoMap);
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
index 7de9e8c..76df131 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java
@@ -18236,6 +18236,109 @@
return result;
}
+ private static Map<String, InteractionInfo> readChimeInteractionInfo() {
+ Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readChimeInstalledChimeSoundsCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeInstalledChimeSoundsAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readInstalledChimeSoundsAttribute(
+ (ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedChimeClusterInstalledChimeSoundsAttributeCallback(),
+ readChimeInstalledChimeSoundsCommandParams
+ );
+ result.put("readInstalledChimeSoundsAttribute", readChimeInstalledChimeSoundsAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeActiveChimeSoundIdCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readActiveChimeSoundIdAttribute(
+ (ChipClusters.IntegerAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
+ readChimeActiveChimeSoundIdCommandParams
+ );
+ result.put("readActiveChimeSoundIdAttribute", readChimeActiveChimeSoundIdAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeEnabledCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeEnabledAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readEnabledAttribute(
+ (ChipClusters.BooleanAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(),
+ readChimeEnabledCommandParams
+ );
+ result.put("readEnabledAttribute", readChimeEnabledAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeGeneratedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readGeneratedCommandListAttribute(
+ (ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedChimeClusterGeneratedCommandListAttributeCallback(),
+ readChimeGeneratedCommandListCommandParams
+ );
+ result.put("readGeneratedCommandListAttribute", readChimeGeneratedCommandListAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeAcceptedCommandListCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readAcceptedCommandListAttribute(
+ (ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedChimeClusterAcceptedCommandListAttributeCallback(),
+ readChimeAcceptedCommandListCommandParams
+ );
+ result.put("readAcceptedCommandListAttribute", readChimeAcceptedCommandListAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeEventListCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeEventListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readEventListAttribute(
+ (ChipClusters.ChimeCluster.EventListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedChimeClusterEventListAttributeCallback(),
+ readChimeEventListCommandParams
+ );
+ result.put("readEventListAttribute", readChimeEventListAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeAttributeListCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeAttributeListAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readAttributeListAttribute(
+ (ChipClusters.ChimeCluster.AttributeListAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedChimeClusterAttributeListAttributeCallback(),
+ readChimeAttributeListCommandParams
+ );
+ result.put("readAttributeListAttribute", readChimeAttributeListAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeFeatureMapCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeFeatureMapAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readFeatureMapAttribute(
+ (ChipClusters.LongAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(),
+ readChimeFeatureMapCommandParams
+ );
+ result.put("readFeatureMapAttribute", readChimeFeatureMapAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> readChimeClusterRevisionCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ InteractionInfo readChimeClusterRevisionAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).readClusterRevisionAttribute(
+ (ChipClusters.IntegerAttributeCallback) callback
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
+ readChimeClusterRevisionCommandParams
+ );
+ result.put("readClusterRevisionAttribute", readChimeClusterRevisionAttributeInteractionInfo);
+
+ return result;
+ }
private static Map<String, InteractionInfo> readEcosystemInformationInteractionInfo() {
Map<String, InteractionInfo> result = new LinkedHashMap<>();Map<String, CommandParameterInfo> readEcosystemInformationDeviceDirectoryCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readEcosystemInformationDeviceDirectoryAttributeInteractionInfo = new InteractionInfo(
@@ -19686,6 +19789,7 @@
put("accountLogin", readAccountLoginInteractionInfo());
put("contentControl", readContentControlInteractionInfo());
put("contentAppObserver", readContentAppObserverInteractionInfo());
+ put("chime", readChimeInteractionInfo());
put("ecosystemInformation", readEcosystemInformationInteractionInfo());
put("commissionerControl", readCommissionerControlInteractionInfo());
put("unitTesting", readUnitTestingInteractionInfo());
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
index b61658c..1e8e727 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java
@@ -3472,6 +3472,52 @@
writeAttributeMap.put("contentControl", writeContentControlInteractionInfo);
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 =
+ new CommandParameterInfo(
+ "value",
+ Integer.class,
+ Integer.class
+ );
+ writeChimeActiveChimeSoundIdCommandParams.put(
+ "value",
+ chimeactiveChimeSoundIdCommandParameterInfo
+ );
+ InteractionInfo writeChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).writeActiveChimeSoundIdAttribute(
+ (DefaultClusterCallback) callback,
+ (Integer) commandArguments.get("value")
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
+ writeChimeActiveChimeSoundIdCommandParams
+ );
+ writeChimeInteractionInfo.put("writeActiveChimeSoundIdAttribute", writeChimeActiveChimeSoundIdAttributeInteractionInfo);
+ Map<String, CommandParameterInfo> writeChimeEnabledCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+ CommandParameterInfo chimeenabledCommandParameterInfo =
+ new CommandParameterInfo(
+ "value",
+ Boolean.class,
+ Boolean.class
+ );
+ writeChimeEnabledCommandParams.put(
+ "value",
+ chimeenabledCommandParameterInfo
+ );
+ InteractionInfo writeChimeEnabledAttributeInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.ChimeCluster) cluster).writeEnabledAttribute(
+ (DefaultClusterCallback) callback,
+ (Boolean) commandArguments.get("value")
+ );
+ },
+ () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(),
+ writeChimeEnabledCommandParams
+ );
+ writeChimeInteractionInfo.put("writeEnabledAttribute", writeChimeEnabledAttributeInteractionInfo);
+ writeAttributeMap.put("chime", writeChimeInteractionInfo);
Map<String, InteractionInfo> writeEcosystemInformationInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("ecosystemInformation", writeEcosystemInformationInteractionInfo);
Map<String, InteractionInfo> writeCommissionerControlInteractionInfo = new LinkedHashMap<>();
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
index bbaa611..397c26e 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni
@@ -28,6 +28,7 @@
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt",
"${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt",
diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt
new file mode 100644
index 0000000..586f6fc
--- /dev/null
+++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package chip.devicecontroller.cluster.structs
+
+import chip.devicecontroller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) {
+ override fun toString(): String = buildString {
+ append("ChimeClusterChimeSoundStruct {\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_NAME), name)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_CHIME_ID = 0
+ private const val TAG_NAME = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct {
+ tlvReader.enterStructure(tlvTag)
+ val chimeId = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID))
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+
+ tlvReader.exitContainer()
+
+ return ChimeClusterChimeSoundStruct(chimeId, name)
+ }
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt
new file mode 100644
index 0000000..2d6242b
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt
@@ -0,0 +1,1009 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package matter.controller.cluster.clusters
+
+import java.time.Duration
+import java.util.logging.Level
+import java.util.logging.Logger
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.transform
+import matter.controller.BooleanSubscriptionState
+import matter.controller.InvokeRequest
+import matter.controller.InvokeResponse
+import matter.controller.MatterController
+import matter.controller.ReadData
+import matter.controller.ReadRequest
+import matter.controller.SubscribeRequest
+import matter.controller.SubscriptionState
+import matter.controller.UByteSubscriptionState
+import matter.controller.UIntSubscriptionState
+import matter.controller.UShortSubscriptionState
+import matter.controller.WriteRequest
+import matter.controller.WriteRequests
+import matter.controller.WriteResponse
+import matter.controller.cluster.structs.*
+import matter.controller.model.AttributePath
+import matter.controller.model.CommandPath
+import matter.tlv.AnonymousTag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ChimeCluster(private val controller: MatterController, private val endpointId: UShort) {
+ class InstalledChimeSoundsAttribute(val value: List<ChimeClusterChimeSoundStruct>)
+
+ sealed class InstalledChimeSoundsAttributeSubscriptionState {
+ data class Success(val value: List<ChimeClusterChimeSoundStruct>) :
+ InstalledChimeSoundsAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : InstalledChimeSoundsAttributeSubscriptionState()
+
+ object SubscriptionEstablished : InstalledChimeSoundsAttributeSubscriptionState()
+ }
+
+ class GeneratedCommandListAttribute(val value: List<UInt>)
+
+ sealed class GeneratedCommandListAttributeSubscriptionState {
+ data class Success(val value: List<UInt>) : GeneratedCommandListAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState()
+
+ object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState()
+ }
+
+ class AcceptedCommandListAttribute(val value: List<UInt>)
+
+ sealed class AcceptedCommandListAttributeSubscriptionState {
+ data class Success(val value: List<UInt>) : AcceptedCommandListAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState()
+
+ object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState()
+ }
+
+ class EventListAttribute(val value: List<UInt>)
+
+ sealed class EventListAttributeSubscriptionState {
+ data class Success(val value: List<UInt>) : EventListAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : EventListAttributeSubscriptionState()
+
+ object SubscriptionEstablished : EventListAttributeSubscriptionState()
+ }
+
+ class AttributeListAttribute(val value: List<UInt>)
+
+ sealed class AttributeListAttributeSubscriptionState {
+ data class Success(val value: List<UInt>) : AttributeListAttributeSubscriptionState()
+
+ data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState()
+
+ object SubscriptionEstablished : AttributeListAttributeSubscriptionState()
+ }
+
+ suspend fun playChimeSound(timedInvokeTimeout: Duration? = null) {
+ val commandId: UInt = 0u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout,
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+ }
+
+ suspend fun readInstalledChimeSoundsAttribute(): InstalledChimeSoundsAttribute {
+ val ATTRIBUTE_ID: UInt = 0u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Installedchimesounds attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<ChimeClusterChimeSoundStruct> =
+ buildList<ChimeClusterChimeSoundStruct> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(ChimeClusterChimeSoundStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return InstalledChimeSoundsAttribute(decodedValue)
+ }
+
+ suspend fun subscribeInstalledChimeSoundsAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<InstalledChimeSoundsAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 0u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ InstalledChimeSoundsAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Installedchimesounds attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<ChimeClusterChimeSoundStruct> =
+ buildList<ChimeClusterChimeSoundStruct> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(ChimeClusterChimeSoundStruct.fromTlv(AnonymousTag, tlvReader))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(InstalledChimeSoundsAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(InstalledChimeSoundsAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readActiveChimeSoundIdAttribute(): UByte {
+ val ATTRIBUTE_ID: UInt = 1u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Activechimesoundid attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun writeActiveChimeSoundIdAttribute(value: UByte, timedWriteTimeout: Duration? = null) {
+ val ATTRIBUTE_ID: UInt = 1u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.put(AnonymousTag, value)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeActiveChimeSoundIdAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<UByteSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 1u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ UByteSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Activechimesoundid attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UByte = tlvReader.getUByte(AnonymousTag)
+
+ emit(UByteSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(UByteSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readEnabledAttribute(): Boolean {
+ val ATTRIBUTE_ID: UInt = 2u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Enabled attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun writeEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) {
+ val ATTRIBUTE_ID: UInt = 2u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.put(AnonymousTag, value)
+
+ val writeRequests: WriteRequests =
+ WriteRequests(
+ requests =
+ listOf(
+ WriteRequest(
+ attributePath =
+ AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID),
+ tlvPayload = tlvWriter.getEncoded(),
+ )
+ ),
+ timedRequest = timedWriteTimeout,
+ )
+
+ val response: WriteResponse = controller.write(writeRequests)
+
+ when (response) {
+ is WriteResponse.Success -> {
+ logger.log(Level.FINE, "Write command succeeded")
+ }
+ is WriteResponse.PartialWriteFailure -> {
+ val aggregatedErrorMessage =
+ response.failures.joinToString("\n") { failure ->
+ "Error at ${failure.attributePath}: ${failure.ex.message}"
+ }
+
+ response.failures.forEach { failure ->
+ logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}")
+ }
+
+ throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage")
+ }
+ }
+ }
+
+ suspend fun subscribeEnabledAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<BooleanSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 2u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ BooleanSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Enabled attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag)
+
+ emit(BooleanSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(BooleanSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute {
+ val ATTRIBUTE_ID: UInt = 65528u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return GeneratedCommandListAttribute(decodedValue)
+ }
+
+ suspend fun subscribeGeneratedCommandListAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<GeneratedCommandListAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65528u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ GeneratedCommandListAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Generatedcommandlist attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute {
+ val ATTRIBUTE_ID: UInt = 65529u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return AcceptedCommandListAttribute(decodedValue)
+ }
+
+ suspend fun subscribeAcceptedCommandListAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<AcceptedCommandListAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65529u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ AcceptedCommandListAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Acceptedcommandlist attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readEventListAttribute(): EventListAttribute {
+ val ATTRIBUTE_ID: UInt = 65530u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Eventlist attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return EventListAttribute(decodedValue)
+ }
+
+ suspend fun subscribeEventListAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<EventListAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65530u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ EventListAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(EventListAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(EventListAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readAttributeListAttribute(): AttributeListAttribute {
+ val ATTRIBUTE_ID: UInt = 65531u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Attributelist attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ return AttributeListAttribute(decodedValue)
+ }
+
+ suspend fun subscribeAttributeListAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<AttributeListAttributeSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65531u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ AttributeListAttributeSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: List<UInt> =
+ buildList<UInt> {
+ tlvReader.enterArray(AnonymousTag)
+ while (!tlvReader.isEndOfContainer()) {
+ add(tlvReader.getUInt(AnonymousTag))
+ }
+ tlvReader.exitContainer()
+ }
+
+ emit(AttributeListAttributeSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readFeatureMapAttribute(): UInt {
+ val ATTRIBUTE_ID: UInt = 65532u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Featuremap attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UInt = tlvReader.getUInt(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun subscribeFeatureMapAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<UIntSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65532u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ UIntSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UInt = tlvReader.getUInt(AnonymousTag)
+
+ emit(UIntSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(UIntSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ suspend fun readClusterRevisionAttribute(): UShort {
+ val ATTRIBUTE_ID: UInt = 65533u
+
+ val attributePath =
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+
+ val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath))
+
+ val response = controller.read(readRequest)
+
+ if (response.successes.isEmpty()) {
+ logger.log(Level.WARNING, "Read command failed")
+ throw IllegalStateException("Read command failed with failures: ${response.failures}")
+ }
+
+ logger.log(Level.FINE, "Read command succeeded")
+
+ val attributeData =
+ response.successes.filterIsInstance<ReadData.Attribute>().firstOrNull {
+ it.path.attributeId == ATTRIBUTE_ID
+ }
+
+ requireNotNull(attributeData) { "Clusterrevision attribute not found in response" }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UShort = tlvReader.getUShort(AnonymousTag)
+
+ return decodedValue
+ }
+
+ suspend fun subscribeClusterRevisionAttribute(
+ minInterval: Int,
+ maxInterval: Int,
+ ): Flow<UShortSubscriptionState> {
+ val ATTRIBUTE_ID: UInt = 65533u
+ val attributePaths =
+ listOf(
+ AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID)
+ )
+
+ val subscribeRequest: SubscribeRequest =
+ SubscribeRequest(
+ eventPaths = emptyList(),
+ attributePaths = attributePaths,
+ minInterval = Duration.ofSeconds(minInterval.toLong()),
+ maxInterval = Duration.ofSeconds(maxInterval.toLong()),
+ )
+
+ return controller.subscribe(subscribeRequest).transform { subscriptionState ->
+ when (subscriptionState) {
+ is SubscriptionState.SubscriptionErrorNotification -> {
+ emit(
+ UShortSubscriptionState.Error(
+ Exception(
+ "Subscription terminated with error code: ${subscriptionState.terminationCause}"
+ )
+ )
+ )
+ }
+ is SubscriptionState.NodeStateUpdate -> {
+ val attributeData =
+ subscriptionState.updateState.successes
+ .filterIsInstance<ReadData.Attribute>()
+ .firstOrNull { it.path.attributeId == ATTRIBUTE_ID }
+
+ requireNotNull(attributeData) {
+ "Clusterrevision attribute not found in Node State update"
+ }
+
+ // Decode the TLV data into the appropriate type
+ val tlvReader = TlvReader(attributeData.data)
+ val decodedValue: UShort = tlvReader.getUShort(AnonymousTag)
+
+ emit(UShortSubscriptionState.Success(decodedValue))
+ }
+ SubscriptionState.SubscriptionEstablished -> {
+ emit(UShortSubscriptionState.SubscriptionEstablished)
+ }
+ }
+ }
+ }
+
+ companion object {
+ private val logger = Logger.getLogger(ChimeCluster::class.java.name)
+ const val CLUSTER_ID: UInt = 1366u
+ }
+}
diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni
index d1a3d96..42e2b95 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/files.gni
+++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni
@@ -28,6 +28,7 @@
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterProgramCategoryStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterProgramStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterSeriesInfoStruct.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentControlClusterRatingNameStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt",
@@ -267,6 +268,7 @@
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonDioxideConcentrationMeasurementCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonMonoxideConcentrationMeasurementCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt",
+ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CommissionerControlCluster.kt",
"${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt",
diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt
new file mode 100644
index 0000000..adc8cbb
--- /dev/null
+++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (c) 2023 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package matter.controller.cluster.structs
+
+import matter.controller.cluster.*
+import matter.tlv.ContextSpecificTag
+import matter.tlv.Tag
+import matter.tlv.TlvReader
+import matter.tlv.TlvWriter
+
+class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) {
+ override fun toString(): String = buildString {
+ append("ChimeClusterChimeSoundStruct {\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_NAME), name)
+ endStructure()
+ }
+ }
+
+ companion object {
+ private const val TAG_CHIME_ID = 0
+ private const val TAG_NAME = 1
+
+ fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct {
+ tlvReader.enterStructure(tlvTag)
+ val chimeId = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID))
+ val name = tlvReader.getString(ContextSpecificTag(TAG_NAME))
+
+ tlvReader.exitContainer()
+
+ return ChimeClusterChimeSoundStruct(chimeId, name)
+ }
+ }
+}
diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
index fbbb5be..c272e84 100644
--- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp
@@ -42220,6 +42220,231 @@
}
break;
}
+ case app::Clusters::Chime::Id: {
+ using namespace app::Clusters::Chime;
+ switch (aPath.mAttributeId)
+ {
+ case Attributes::InstalledChimeSounds::Id: {
+ using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ jobject newElement_0_chimeId;
+ std::string newElement_0_chimeIdClassName = "java/lang/Integer";
+ std::string newElement_0_chimeIdCtorSignature = "(I)V";
+ jint jninewElement_0_chimeId = static_cast<jint>(entry_0.chimeId);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(newElement_0_chimeIdClassName.c_str(),
+ newElement_0_chimeIdCtorSignature.c_str(),
+ jninewElement_0_chimeId, newElement_0_chimeId);
+ jobject newElement_0_name;
+ LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name));
+
+ jclass chimeSoundStructStructClass_1;
+ err = chip::JniReferences::GetInstance().GetLocalClassRef(
+ env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct");
+ return nullptr;
+ }
+
+ jmethodID chimeSoundStructStructCtor_1;
+ err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "<init>",
+ "(Ljava/lang/Integer;Ljava/lang/String;)V",
+ &chimeSoundStructStructCtor_1);
+ if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor");
+ return nullptr;
+ }
+
+ newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeId,
+ newElement_0_name);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::ActiveChimeSoundId::Id: {
+ using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast<jint>(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue,
+ value);
+ return value;
+ }
+ case Attributes::Enabled::Id: {
+ using TypeInfo = Attributes::Enabled::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Boolean";
+ std::string valueCtorSignature = "(Z)V";
+ jboolean jnivalue = static_cast<jboolean>(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jboolean>(valueClassName.c_str(), valueCtorSignature.c_str(),
+ jnivalue, value);
+ return value;
+ }
+ case Attributes::GeneratedCommandList::Id: {
+ using TypeInfo = Attributes::GeneratedCommandList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast<jlong>(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::AcceptedCommandList::Id: {
+ using TypeInfo = Attributes::AcceptedCommandList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast<jlong>(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::EventList::Id: {
+ using TypeInfo = Attributes::EventList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast<jlong>(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::AttributeList::Id: {
+ using TypeInfo = Attributes::AttributeList::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ chip::JniReferences::GetInstance().CreateArrayList(value);
+
+ auto iter_value_0 = cppValue.begin();
+ while (iter_value_0.Next())
+ {
+ auto & entry_0 = iter_value_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Long";
+ std::string newElement_0CtorSignature = "(J)V";
+ jlong jninewElement_0 = static_cast<jlong>(entry_0);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value, newElement_0);
+ }
+ return value;
+ }
+ case Attributes::FeatureMap::Id: {
+ using TypeInfo = Attributes::FeatureMap::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Long";
+ std::string valueCtorSignature = "(J)V";
+ jlong jnivalue = static_cast<jlong>(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jlong>(valueClassName.c_str(), valueCtorSignature.c_str(),
+ jnivalue, value);
+ return value;
+ }
+ case Attributes::ClusterRevision::Id: {
+ using TypeInfo = Attributes::ClusterRevision::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value;
+ std::string valueClassName = "java/lang/Integer";
+ std::string valueCtorSignature = "(I)V";
+ jint jnivalue = static_cast<jint>(cppValue);
+ chip::JniReferences::GetInstance().CreateBoxedObject<jint>(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue,
+ value);
+ return value;
+ }
+ default:
+ *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB;
+ break;
+ }
+ break;
+ }
case app::Clusters::EcosystemInformation::Id: {
using namespace app::Clusters::EcosystemInformation;
switch (aPath.mAttributeId)
diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
index dd385a7..2dc46ab 100644
--- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
@@ -8248,6 +8248,16 @@
}
break;
}
+ case app::Clusters::Chime::Id: {
+ using namespace app::Clusters::Chime;
+ switch (aPath.mEventId)
+ {
+ default:
+ *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB;
+ break;
+ }
+ break;
+ }
case app::Clusters::EcosystemInformation::Id: {
using namespace app::Clusters::EcosystemInformation;
switch (aPath.mEventId)
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index af684af..1b5f2e6 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -13029,6 +13029,76 @@
},
},
}
+ _CHIME_CLUSTER_INFO = {
+ "clusterName": "Chime",
+ "clusterId": 0x00000556,
+ "commands": {
+ 0x00000000: {
+ "commandId": 0x00000000,
+ "commandName": "PlayChimeSound",
+ "args": {
+ },
+ },
+ },
+ "attributes": {
+ 0x00000000: {
+ "attributeName": "InstalledChimeSounds",
+ "attributeId": 0x00000000,
+ "type": "",
+ "reportable": True,
+ },
+ 0x00000001: {
+ "attributeName": "ActiveChimeSoundId",
+ "attributeId": 0x00000001,
+ "type": "int",
+ "reportable": True,
+ "writable": True,
+ },
+ 0x00000002: {
+ "attributeName": "Enabled",
+ "attributeId": 0x00000002,
+ "type": "bool",
+ "reportable": True,
+ "writable": True,
+ },
+ 0x0000FFF8: {
+ "attributeName": "GeneratedCommandList",
+ "attributeId": 0x0000FFF8,
+ "type": "int",
+ "reportable": True,
+ },
+ 0x0000FFF9: {
+ "attributeName": "AcceptedCommandList",
+ "attributeId": 0x0000FFF9,
+ "type": "int",
+ "reportable": True,
+ },
+ 0x0000FFFA: {
+ "attributeName": "EventList",
+ "attributeId": 0x0000FFFA,
+ "type": "int",
+ "reportable": True,
+ },
+ 0x0000FFFB: {
+ "attributeName": "AttributeList",
+ "attributeId": 0x0000FFFB,
+ "type": "int",
+ "reportable": True,
+ },
+ 0x0000FFFC: {
+ "attributeName": "FeatureMap",
+ "attributeId": 0x0000FFFC,
+ "type": "int",
+ "reportable": True,
+ },
+ 0x0000FFFD: {
+ "attributeName": "ClusterRevision",
+ "attributeId": 0x0000FFFD,
+ "type": "int",
+ "reportable": True,
+ },
+ },
+ }
_ECOSYSTEM_INFORMATION_CLUSTER_INFO = {
"clusterName": "EcosystemInformation",
"clusterId": 0x00000750,
@@ -14277,6 +14347,7 @@
0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO,
0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO,
0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO,
+ 0x00000556: _CHIME_CLUSTER_INFO,
0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO,
0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO,
0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO,
@@ -14402,6 +14473,7 @@
"AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO,
"ContentControl": _CONTENT_CONTROL_CLUSTER_INFO,
"ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO,
+ "Chime": _CHIME_CLUSTER_INFO,
"EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO,
"CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO,
"UnitTesting": _UNIT_TESTING_CLUSTER_INFO,
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index 6a9e0b8..c70def4 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -156,6 +156,7 @@
"AccountLogin",
"ContentControl",
"ContentAppObserver",
+ "Chime",
"EcosystemInformation",
"CommissionerControl",
"UnitTesting",
@@ -46506,6 +46507,209 @@
@dataclass
+class Chime(Cluster):
+ id: typing.ClassVar[int] = 0x00000556
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="installedChimeSounds", Tag=0x00000000, Type=typing.List[Chime.Structs.ChimeSoundStruct]),
+ ClusterObjectFieldDescriptor(Label="activeChimeSoundId", Tag=0x00000001, Type=uint),
+ ClusterObjectFieldDescriptor(Label="enabled", Tag=0x00000002, Type=bool),
+ ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]),
+ ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]),
+ ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]),
+ ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]),
+ ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint),
+ ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint),
+ ])
+
+ installedChimeSounds: 'typing.List[Chime.Structs.ChimeSoundStruct]' = None
+ activeChimeSoundId: 'uint' = None
+ enabled: 'bool' = None
+ generatedCommandList: 'typing.List[uint]' = None
+ acceptedCommandList: 'typing.List[uint]' = None
+ eventList: 'typing.List[uint]' = None
+ attributeList: 'typing.List[uint]' = None
+ featureMap: 'uint' = None
+ clusterRevision: 'uint' = None
+
+ class Structs:
+ @dataclass
+ class ChimeSoundStruct(ClusterObject):
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="chimeId", Tag=0, Type=uint),
+ ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str),
+ ])
+
+ chimeId: 'uint' = 0
+ name: 'str' = ""
+
+ class Commands:
+ @dataclass
+ class PlayChimeSound(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0x00000556
+ command_id: typing.ClassVar[int] = 0x00000000
+ is_client: typing.ClassVar[bool] = True
+ response_type: typing.ClassVar[str] = None
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ])
+
+ class Attributes:
+ @dataclass
+ class InstalledChimeSounds(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00000000
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.List[Chime.Structs.ChimeSoundStruct])
+
+ value: 'typing.List[Chime.Structs.ChimeSoundStruct]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class ActiveChimeSoundId(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00000001
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=uint)
+
+ value: 'uint' = 0
+
+ @dataclass
+ class Enabled(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x00000002
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=bool)
+
+ value: 'bool' = False
+
+ @dataclass
+ class GeneratedCommandList(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFF8
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.List[uint])
+
+ value: 'typing.List[uint]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class AcceptedCommandList(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFF9
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.List[uint])
+
+ value: 'typing.List[uint]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class EventList(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFFA
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.List[uint])
+
+ value: 'typing.List[uint]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class AttributeList(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFFB
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=typing.List[uint])
+
+ value: 'typing.List[uint]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class FeatureMap(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFFC
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=uint)
+
+ value: 'uint' = 0
+
+ @dataclass
+ class ClusterRevision(ClusterAttributeDescriptor):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x00000556
+
+ @ChipUtility.classproperty
+ def attribute_id(cls) -> int:
+ return 0x0000FFFD
+
+ @ChipUtility.classproperty
+ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
+ return ClusterObjectFieldDescriptor(Type=uint)
+
+ value: 'uint' = 0
+
+
+@dataclass
class EcosystemInformation(Cluster):
id: typing.ClassVar[int] = 0x00000750
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
index 6c1548f..f94445c 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm
@@ -5912,6 +5912,42 @@
}
}
}
+static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId)
+{
+ using namespace Clusters::Chime;
+ switch (aAttributeId) {
+ case Attributes::InstalledChimeSounds::Id: {
+ return YES;
+ }
+ case Attributes::ActiveChimeSoundId::Id: {
+ return YES;
+ }
+ case Attributes::Enabled::Id: {
+ return YES;
+ }
+ case Attributes::GeneratedCommandList::Id: {
+ return YES;
+ }
+ case Attributes::AcceptedCommandList::Id: {
+ return YES;
+ }
+ case Attributes::EventList::Id: {
+ return YES;
+ }
+ case Attributes::AttributeList::Id: {
+ return YES;
+ }
+ case Attributes::FeatureMap::Id: {
+ return YES;
+ }
+ case Attributes::ClusterRevision::Id: {
+ return YES;
+ }
+ default: {
+ return NO;
+ }
+ }
+}
static BOOL AttributeIsSpecifiedInEcosystemInformationCluster(AttributeId aAttributeId)
{
using namespace Clusters::EcosystemInformation;
@@ -6645,6 +6681,9 @@
case Clusters::ContentAppObserver::Id: {
return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId);
}
+ case Clusters::Chime::Id: {
+ return AttributeIsSpecifiedInChimeCluster(aAttributeId);
+ }
case Clusters::EcosystemInformation::Id: {
return AttributeIsSpecifiedInEcosystemInformationCluster(aAttributeId);
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
index 4affde0..3b8fff3 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm
@@ -16899,6 +16899,73 @@
*aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB;
return nil;
}
+static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError)
+{
+ using namespace Clusters::Chime;
+ switch (aAttributeId) {
+ case Attributes::InstalledChimeSounds::Id: {
+ using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ NSArray * _Nonnull value;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ MTRChimeClusterChimeSoundStruct * newElement_0;
+ newElement_0 = [MTRChimeClusterChimeSoundStruct new];
+ newElement_0.chimeId = [NSNumber numberWithUnsignedChar:entry_0.chimeId];
+ newElement_0.name = AsString(entry_0.name);
+ if (newElement_0.name == nil) {
+ CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT;
+ *aError = err;
+ return nil;
+ }
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ value = array_0;
+ }
+ return value;
+ }
+ case Attributes::ActiveChimeSoundId::Id: {
+ using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ NSNumber * _Nonnull value;
+ value = [NSNumber numberWithUnsignedChar:cppValue];
+ return value;
+ }
+ case Attributes::Enabled::Id: {
+ using TypeInfo = Attributes::Enabled::TypeInfo;
+ TypeInfo::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+ NSNumber * _Nonnull value;
+ value = [NSNumber numberWithBool:cppValue];
+ return value;
+ }
+ default: {
+ break;
+ }
+ }
+
+ *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB;
+ return nil;
+}
static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError)
{
using namespace Clusters::EcosystemInformation;
@@ -19008,6 +19075,9 @@
case Clusters::ContentAppObserver::Id: {
return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError);
}
+ case Clusters::Chime::Id: {
+ return DecodeAttributeValueForChimeCluster(aPath.mAttributeId, aReader, aError);
+ }
case Clusters::EcosystemInformation::Id: {
return DecodeAttributeValueForEcosystemInformationCluster(aPath.mAttributeId, aReader, aError);
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index bcf76c9..cbc390c 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -14757,6 +14757,98 @@
@end
/**
+ * Cluster Chime
+ *
+ *
+ */
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRBaseClusterChime : MTRGenericBaseCluster
+
+/**
+ * Command PlayChimeSound
+ *
+ *
+ */
+- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion
+ MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeInstalledChimeSoundsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeInstalledChimeSoundsWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE;
++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+@end
+
+@interface MTRBaseClusterChime (Availability)
+
+/**
+ * For all instance methods (reads, writes, commands) that take a completion,
+ * the completion will be called on the provided queue.
+ */
+- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device
+ endpointID:(NSNumber *)endpointID
+ queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE;
+
+@end
+
+/**
* Cluster Ecosystem Information
*
* Provides extended device information for all the logical devices represented by a Bridged Node.
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
index 67025a0..f129e16 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
@@ -102085,6 +102085,419 @@
@end
+@implementation MTRBaseClusterChime
+
+- (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion
+{
+ [self playChimeSoundWithParams:nil completion:completion];
+}
+- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ if (params == nil) {
+ params = [[MTRChimeClusterPlayChimeSoundParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = Chime::Commands::PlayChimeSound::Type;
+ [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:nil
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+
+- (void)readAttributeInstalledChimeSoundsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeInstalledChimeSoundsWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull) value params:nil completion:completion];
+}
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo;
+ TypeInfo::Type cppValue;
+ cppValue = value.unsignedCharValue;
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::Enabled::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion
+{
+ [self writeAttributeEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion];
+}
+- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion
+{
+ // Make a copy of params before we go async.
+ params = [params copy];
+ value = [value copy];
+
+ auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) {
+ chip::Optional<uint16_t> timedWriteTimeout;
+ if (params != nil) {
+ if (params.timedWriteTimeout != nil){
+ timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue);
+ }
+ }
+
+ ListFreer listFreer;
+ using TypeInfo = Chime::Attributes::Enabled::TypeInfo;
+ TypeInfo::Type cppValue;
+ cppValue = value.boolValue;
+
+ chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue);
+ return cppCluster.WriteAttribute<TypeInfo>(cppValue, bridge, successCb, failureCb, timedWriteTimeout); });
+ std::move(*bridge).DispatchAction(self.device);
+}
+
+- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::Enabled::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::Enabled::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::EventList::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::EventList::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::EventList::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::AttributeList::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::AttributeList::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::AttributeList::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo;
+ [self.device _readKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:nil
+ queue:self.callbackQueue
+ completion:completion];
+}
+
+- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params
+ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished
+ reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler
+{
+ using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo;
+ [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID
+ clusterID:@(TypeInfo::GetClusterId())
+ attributeID:@(TypeInfo::GetAttributeId())
+ params:params
+ queue:self.callbackQueue
+ reportHandler:reportHandler
+ subscriptionEstablished:subscriptionEstablished];
+}
+
++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
+{
+ using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo;
+ [clusterStateCacheContainer
+ _readKnownCachedAttributeWithEndpointID:static_cast<chip::EndpointId>([endpoint unsignedShortValue])
+ clusterID:TypeInfo::GetClusterId()
+ attributeID:TypeInfo::GetAttributeId()
+ queue:queue
+ completion:completion];
+}
+
+@end
+
@implementation MTRBaseClusterEcosystemInformation
- (void)readAttributeDeviceDirectoryWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
index b866004..72233c4 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
@@ -197,6 +197,7 @@
MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E,
MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F,
MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510,
+ MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556,
MTRClusterIDTypeEcosystemInformationID MTR_PROVISIONALLY_AVAILABLE = 0x00000750,
MTRClusterIDTypeCommissionerControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000751,
MTRClusterIDTypeUnitTestingID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05,
@@ -4738,6 +4739,17 @@
MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID,
MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID,
+ // Cluster Chime attributes
+ MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
+ MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID MTR_PROVISIONALLY_AVAILABLE = 0x00000001,
+ MTRAttributeIDTypeClusterChimeAttributeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000002,
+ MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID,
+ MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID,
+ MTRAttributeIDTypeClusterChimeAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID,
+ MTRAttributeIDTypeClusterChimeAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID,
+ MTRAttributeIDTypeClusterChimeAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID,
+ MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID,
+
// Cluster EcosystemInformation attributes
MTRAttributeIDTypeClusterEcosystemInformationAttributeDeviceDirectoryID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
MTRAttributeIDTypeClusterEcosystemInformationAttributeLocationDirectoryID MTR_PROVISIONALLY_AVAILABLE = 0x00000001,
@@ -6931,6 +6943,9 @@
MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001,
+ // Cluster Chime commands
+ MTRCommandIDTypeClusterChimeCommandPlayChimeSoundID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
+
// Cluster CommissionerControl commands
MTRCommandIDTypeClusterCommissionerControlCommandRequestCommissioningApprovalID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
MTRCommandIDTypeClusterCommissionerControlCommandCommissionNodeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001,
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
index 59b1003..00c2db4 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm
@@ -369,6 +369,9 @@
case MTRClusterIDTypeContentAppObserverID:
result = @"ContentAppObserver";
break;
+ case MTRClusterIDTypeChimeID:
+ result = @"Chime";
+ break;
case MTRClusterIDTypeEcosystemInformationID:
result = @"EcosystemInformation";
break;
@@ -8136,6 +8139,53 @@
}
break;
+ case MTRClusterIDTypeChimeID:
+
+ switch (attributeID) {
+
+ // Cluster Chime attributes
+ case MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID:
+ result = @"InstalledChimeSounds";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID:
+ result = @"ActiveChimeSoundId";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeEnabledID:
+ result = @"Enabled";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID:
+ result = @"GeneratedCommandList";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID:
+ result = @"AcceptedCommandList";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeEventListID:
+ result = @"EventList";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeAttributeListID:
+ result = @"AttributeList";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeFeatureMapID:
+ result = @"FeatureMap";
+ break;
+
+ case MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID:
+ result = @"ClusterRevision";
+ break;
+
+ default:
+ result = [NSString stringWithFormat:@"<Unknown attributeID %d>", attributeID];
+ break;
+ }
+ break;
+
case MTRClusterIDTypeEcosystemInformationID:
switch (attributeID) {
@@ -10287,6 +10337,16 @@
}
break;
+ case MTRClusterIDTypeChimeID:
+
+ switch (eventID) {
+
+ default:
+ result = [NSString stringWithFormat:@"<Unknown eventID %d>", eventID];
+ break;
+ }
+ break;
+
case MTRClusterIDTypeEcosystemInformationID:
switch (eventID) {
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
index 3a761fa..2b329ff 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
@@ -6825,6 +6825,56 @@
@end
/**
+ * Cluster Chime
+ *
+ */
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRClusterChime : MTRGenericCluster
+
+- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)playChimeSoundWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion
+ MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeInstalledChimeSoundsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeEnabledWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE;
+- (void)writeAttributeEnabledWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE;
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+@end
+
+@interface MTRClusterChime (Availability)
+
+/**
+ * For all instance methods that take a completion (i.e. command invocations),
+ * the completion will be called on the provided queue.
+ */
+- (instancetype _Nullable)initWithDevice:(MTRDevice *)device
+ endpointID:(NSNumber *)endpointID
+ queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE;
+
+@end
+
+/**
* Cluster Ecosystem Information
* Provides extended device information for all the logical devices represented by a Bridged Node.
*/
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
index 2ce4294..c745143 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
@@ -19549,6 +19549,108 @@
@end
+@implementation MTRClusterChime
+
+- (void)playChimeSoundWithExpectedValues:(NSArray<NSDictionary<NSString *, id> *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion
+{
+ [self playChimeSoundWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion];
+}
+- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion
+{
+ if (params == nil) {
+ params = [[MTRChimeClusterPlayChimeSoundParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = Chime::Commands::PlayChimeSound::Type;
+ [self.device _invokeKnownCommandWithEndpointID:self.endpointID
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ expectedValues:expectedValues
+ expectedValueInterval:expectedValueIntervalMs
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:nil
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeInstalledChimeSoundsWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) params:params];
+}
+
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeActiveChimeSoundIdWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEnabledID) params:params];
+}
+
+- (void)writeAttributeEnabledWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs
+{
+ [self writeAttributeEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil];
+}
+- (void)writeAttributeEnabledWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params
+{
+ NSNumber * timedWriteTimeout = params.timedWriteTimeout;
+
+ [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEventListID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeAttributeListID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeFeatureMapID) params:params];
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params
+{
+ return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID) params:params];
+}
+
+@end
+
@implementation MTRClusterEcosystemInformation
- (NSDictionary<NSString *, id> * _Nullable)readAttributeDeviceDirectoryWithParams:(MTRReadParams * _Nullable)params
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
index 7135f3d..27a21e0 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
@@ -10836,6 +10836,34 @@
@end
MTR_PROVISIONALLY_AVAILABLE
+@interface MTRChimeClusterPlayChimeSoundParams : NSObject <NSCopying>
+/**
+ * Controls whether the command is a timed command (using Timed Invoke).
+ *
+ * If nil (the default value), a regular invoke is done for commands that do
+ * not require a timed invoke and a timed invoke with some default timed request
+ * timeout is done for commands that require a timed invoke.
+ *
+ * If not nil, a timed invoke is done, with the provided value used as the timed
+ * request timeout. The value should be chosen small enough to provide the
+ * desired security properties but large enough that it will allow a round-trip
+ * from the sever to the client (for the status response and actual invoke
+ * request) within the timeout window.
+ *
+ */
+@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs;
+
+/**
+ * Controls how much time, in seconds, we will allow for the server to process the command.
+ *
+ * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes.
+ *
+ * If nil, the framework will try to select an appropriate timeout value itself.
+ */
+@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
@interface MTRCommissionerControlClusterRequestCommissioningApprovalParams : NSObject <NSCopying>
@property (nonatomic, copy) NSNumber * _Nonnull requestID MTR_PROVISIONALLY_AVAILABLE;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
index ec90ce4..4783d5b 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
@@ -31337,6 +31337,79 @@
@end
+@implementation MTRChimeClusterPlayChimeSoundParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+ _timedInvokeTimeoutMs = nil;
+ _serverSideProcessingTimeout = nil;
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRChimeClusterPlayChimeSoundParams alloc] init];
+
+ other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
+ other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRChimeClusterPlayChimeSoundParams (InternalMethods)
+
+- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
+{
+ chip::app::Clusters::Chime::Commands::PlayChimeSound::Type encodableStruct;
+ ListFreer listFreer;
+
+ auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
+ if (buffer.IsNull()) {
+ return CHIP_ERROR_NO_MEMORY;
+ }
+
+ chip::System::PacketBufferTLVWriter writer;
+ // Commands never need chained buffers, since they cannot be chunked.
+ writer.Init(std::move(buffer), /* useChainedBuffers = */ false);
+
+ ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct));
+
+ ReturnErrorOnFailure(writer.Finalize(&buffer));
+
+ reader.Init(std::move(buffer));
+ return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag());
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error
+{
+ chip::System::PacketBufferTLVReader reader;
+ CHIP_ERROR err = [self _encodeToTLVReader:reader];
+ if (err != CHIP_NO_ERROR) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:err];
+ }
+ return nil;
+ }
+
+ auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader);
+ if (decodedObj == nil) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
+ }
+ }
+ return decodedObj;
+}
+@end
+
@implementation MTRCommissionerControlClusterRequestCommissioningApprovalParams
- (instancetype)init
{
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
index 1d5bc86..e7c5f23 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
@@ -2032,6 +2032,12 @@
@end
+@interface MTRChimeClusterPlayChimeSoundParams (InternalMethods)
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
+
+@end
+
@interface MTRCommissionerControlClusterRequestCommissioningApprovalParams (InternalMethods)
- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm
index 3724ec0..6b5fed7 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm
@@ -1124,6 +1124,15 @@
}
}
}
+static BOOL CommandNeedsTimedInvokeInChimeCluster(AttributeId aAttributeId)
+{
+ using namespace Clusters::Chime;
+ switch (aAttributeId) {
+ default: {
+ return NO;
+ }
+ }
+}
static BOOL CommandNeedsTimedInvokeInEcosystemInformationCluster(AttributeId aAttributeId)
{
using namespace Clusters::EcosystemInformation;
@@ -1512,6 +1521,9 @@
case Clusters::ContentAppObserver::Id: {
return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID);
}
+ case Clusters::Chime::Id: {
+ return CommandNeedsTimedInvokeInChimeCluster(commandID);
+ }
case Clusters::EcosystemInformation::Id: {
return CommandNeedsTimedInvokeInEcosystemInformationCluster(commandID);
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
index 4b493a9..d3163c2 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
@@ -4543,6 +4543,18 @@
*aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB;
return nil;
}
+static id _Nullable DecodeEventPayloadForChimeCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError)
+{
+ using namespace Clusters::Chime;
+ switch (aEventId) {
+ default: {
+ break;
+ }
+ }
+
+ *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB;
+ return nil;
+}
static id _Nullable DecodeEventPayloadForEcosystemInformationCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError)
{
using namespace Clusters::EcosystemInformation;
@@ -5133,6 +5145,9 @@
case Clusters::ContentAppObserver::Id: {
return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError);
}
+ case Clusters::Chime::Id: {
+ return DecodeEventPayloadForChimeCluster(aPath.mEventId, aReader, aError);
+ }
case Clusters::EcosystemInformation::Id: {
return DecodeEventPayloadForEcosystemInformationCluster(aPath.mEventId, aReader, aError);
}
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
index 61aa516..2aecf40 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
@@ -2118,6 +2118,12 @@
@end
MTR_PROVISIONALLY_AVAILABLE
+@interface MTRChimeClusterChimeSoundStruct : NSObject <NSCopying>
+@property (nonatomic, copy) NSNumber * _Nonnull chimeId MTR_PROVISIONALLY_AVAILABLE;
+@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
@interface MTREcosystemInformationClusterDeviceTypeStruct : NSObject <NSCopying>
@property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_PROVISIONALLY_AVAILABLE;
@property (nonatomic, copy) NSNumber * _Nonnull revision MTR_PROVISIONALLY_AVAILABLE;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
index 5cb5806..67b0774 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
@@ -8768,6 +8768,36 @@
@end
+@implementation MTRChimeClusterChimeSoundStruct
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _chimeId = @(0);
+
+ _name = @"";
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone
+{
+ auto other = [[MTRChimeClusterChimeSoundStruct alloc] init];
+
+ other.chimeId = self.chimeId;
+ other.name = self.name;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: chimeId:%@; name:%@; >", NSStringFromClass([self class]), _chimeId, _name];
+ return descriptionString;
+}
+
+@end
+
@implementation MTREcosystemInformationClusterDeviceTypeStruct
- (instancetype)init
{
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
index 4d9c6b9..2ccdf50 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
@@ -36667,6 +36667,196 @@
} // namespace Attributes
} // namespace ContentAppObserver
+namespace Chime {
+namespace Attributes {
+
+namespace ActiveChimeSoundId {
+
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value)
+{
+ using Traits = NumericAttributeTraits<uint8_t>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ *value = Traits::StorageToWorking(temp);
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<uint8_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
+ EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value)
+{
+ using Traits = NumericAttributeTraits<uint8_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE);
+}
+
+} // namespace ActiveChimeSoundId
+
+namespace Enabled {
+
+Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value)
+{
+ using Traits = NumericAttributeTraits<bool>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ *value = Traits::StorageToWorking(temp);
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<bool>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
+ EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value)
+{
+ using Traits = NumericAttributeTraits<bool>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
+}
+
+} // namespace Enabled
+
+namespace FeatureMap {
+
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value)
+{
+ using Traits = NumericAttributeTraits<uint32_t>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ *value = Traits::StorageToWorking(temp);
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<uint32_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
+ EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value)
+{
+ using Traits = NumericAttributeTraits<uint32_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE);
+}
+
+} // namespace FeatureMap
+
+namespace ClusterRevision {
+
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value)
+{
+ using Traits = NumericAttributeTraits<uint16_t>;
+ Traits::StorageType temp;
+ uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp);
+ Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp));
+ VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status);
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, temp))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ *value = Traits::StorageToWorking(temp);
+ return status;
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty)
+{
+ using Traits = NumericAttributeTraits<uint16_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id),
+ EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty));
+}
+
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value)
+{
+ using Traits = NumericAttributeTraits<uint16_t>;
+ if (!Traits::CanRepresentValue(/* isNullable = */ false, value))
+ {
+ return Protocols::InteractionModel::Status::ConstraintError;
+ }
+ Traits::StorageType storageValue;
+ Traits::WorkingToStorage(value, storageValue);
+ uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue);
+ return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE);
+}
+
+} // namespace ClusterRevision
+
+} // namespace Attributes
+} // namespace Chime
+
namespace EcosystemInformation {
namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
index c4b83e7..7d60e62 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h
@@ -5563,6 +5563,36 @@
} // namespace Attributes
} // namespace ContentAppObserver
+namespace Chime {
+namespace Attributes {
+
+namespace ActiveChimeSoundId {
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value);
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty);
+} // namespace ActiveChimeSoundId
+
+namespace Enabled {
+Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean
+Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value);
+Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty);
+} // namespace Enabled
+
+namespace FeatureMap {
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value);
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty);
+} // namespace FeatureMap
+
+namespace ClusterRevision {
+Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value);
+Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty);
+} // namespace ClusterRevision
+
+} // namespace Attributes
+} // namespace Chime
+
namespace EcosystemInformation {
namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h
index 7e86e92..59e11e3 100644
--- a/zzz_generated/app-common/app-common/zap-generated/callback.h
+++ b/zzz_generated/app-common/app-common/zap-generated/callback.h
@@ -621,6 +621,11 @@
/**
* @param endpoint Endpoint that is being initialized
*/
+void emberAfChimeClusterInitCallback(chip::EndpointId endpoint);
+
+/**
+ * @param endpoint Endpoint that is being initialized
+ */
void emberAfEcosystemInformationClusterInitCallback(chip::EndpointId endpoint);
/**
@@ -5168,6 +5173,45 @@
void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint);
//
+// Chime Cluster
+//
+
+/**
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfChimeClusterServerInitCallback(chip::EndpointId endpoint);
+
+/**
+ * @param endpoint Endpoint that is being shutdown
+ */
+void MatterChimeClusterServerShutdownCallback(chip::EndpointId endpoint);
+
+/**
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfChimeClusterClientInitCallback(chip::EndpointId endpoint);
+
+/**
+ * @param attributePath Concrete attribute path that changed
+ */
+void MatterChimeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath);
+
+/**
+ * @param attributePath Concrete attribute path to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+chip::Protocols::InteractionModel::Status
+MatterChimeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath,
+ EmberAfAttributeType attributeType, uint16_t size, uint8_t * value);
+
+/**
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfChimeClusterServerTickCallback(chip::EndpointId endpoint);
+
+//
// Ecosystem Information Cluster
//
@@ -6558,6 +6602,12 @@
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData);
/**
+ * @brief Chime Cluster PlayChimeSound Command callback (from client)
+ */
+bool emberAfChimeClusterPlayChimeSoundCallback(
+ chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::Chime::Commands::PlayChimeSound::DecodableType & commandData);
+/**
* @brief Commissioner Control Cluster RequestCommissioningApproval Command callback (from client)
*/
bool emberAfCommissionerControlClusterRequestCommissioningApprovalCallback(
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
index c55fab3..206d3da 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h
@@ -5392,6 +5392,8 @@
};
} // namespace ContentAppObserver
+namespace Chime {} // namespace Chime
+
namespace EcosystemInformation {} // namespace EcosystemInformation
namespace CommissionerControl {
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
index 3029e31..9c7cad3 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
@@ -28476,6 +28476,106 @@
namespace Events {} // namespace Events
} // namespace ContentAppObserver
+namespace Chime {
+namespace Structs {
+
+namespace ChimeSoundStruct {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kChimeId), chimeId);
+ encoder.Encode(to_underlying(Fields::kName), name);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kChimeId))
+ {
+ err = DataModel::Decode(reader, chimeId);
+ }
+ else if (__context_tag == to_underlying(Fields::kName))
+ {
+ err = DataModel::Decode(reader, name);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+
+} // namespace ChimeSoundStruct
+} // namespace Structs
+
+namespace Commands {
+namespace PlayChimeSound {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+ }
+}
+} // namespace PlayChimeSound.
+} // namespace Commands
+
+namespace Attributes {
+CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path)
+{
+ switch (path.mAttributeId)
+ {
+ case Attributes::InstalledChimeSounds::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, installedChimeSounds);
+ case Attributes::ActiveChimeSoundId::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, activeChimeSoundId);
+ case Attributes::Enabled::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, enabled);
+ case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, generatedCommandList);
+ case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, acceptedCommandList);
+ case Attributes::EventList::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, eventList);
+ case Attributes::AttributeList::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, attributeList);
+ case Attributes::FeatureMap::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, featureMap);
+ case Attributes::ClusterRevision::TypeInfo::GetAttributeId():
+ return DataModel::Decode(reader, clusterRevision);
+ default:
+ return CHIP_NO_ERROR;
+ }
+}
+} // namespace Attributes
+
+namespace Events {} // namespace Events
+
+} // namespace Chime
namespace EcosystemInformation {
namespace Structs {
@@ -32399,6 +32499,13 @@
return false;
}
}
+ case Clusters::Chime::Id: {
+ switch (aCommand)
+ {
+ default:
+ return false;
+ }
+ }
case Clusters::CommissionerControl::Id: {
switch (aCommand)
{
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index 16042f9..59d48f7 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -41196,6 +41196,171 @@
};
} // namespace Attributes
} // namespace ContentAppObserver
+namespace Chime {
+namespace Structs {
+namespace ChimeSoundStruct {
+enum class Fields : uint8_t
+{
+ kChimeId = 0,
+ kName = 1,
+};
+
+struct Type
+{
+public:
+ uint8_t chimeId = static_cast<uint8_t>(0);
+ chip::CharSpan name;
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+
+ static constexpr bool kIsFabricScoped = false;
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+};
+
+using DecodableType = Type;
+
+} // namespace ChimeSoundStruct
+} // namespace Structs
+
+namespace Commands {
+// Forward-declarations so we can reference these later.
+
+namespace PlayChimeSound {
+struct Type;
+struct DecodableType;
+} // namespace PlayChimeSound
+
+} // namespace Commands
+
+namespace Commands {
+namespace PlayChimeSound {
+enum class Fields : uint8_t
+{
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::PlayChimeSound::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = DataModel::NullObjectType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::PlayChimeSound::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace PlayChimeSound
+} // namespace Commands
+
+namespace Attributes {
+
+namespace InstalledChimeSounds {
+struct TypeInfo
+{
+ using Type = chip::app::DataModel::List<const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type>;
+ using DecodableType = chip::app::DataModel::DecodableList<chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType>;
+ using DecodableArgType =
+ const chip::app::DataModel::DecodableList<chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType> &;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::InstalledChimeSounds::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace InstalledChimeSounds
+namespace ActiveChimeSoundId {
+struct TypeInfo
+{
+ using Type = uint8_t;
+ using DecodableType = uint8_t;
+ using DecodableArgType = uint8_t;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::ActiveChimeSoundId::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace ActiveChimeSoundId
+namespace Enabled {
+struct TypeInfo
+{
+ using Type = bool;
+ using DecodableType = bool;
+ using DecodableArgType = bool;
+
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+ static constexpr AttributeId GetAttributeId() { return Attributes::Enabled::Id; }
+ static constexpr bool MustUseTimedWrite() { return false; }
+};
+} // namespace Enabled
+namespace GeneratedCommandList {
+struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace GeneratedCommandList
+namespace AcceptedCommandList {
+struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace AcceptedCommandList
+namespace EventList {
+struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace EventList
+namespace AttributeList {
+struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace AttributeList
+namespace FeatureMap {
+struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace FeatureMap
+namespace ClusterRevision {
+struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo
+{
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+};
+} // namespace ClusterRevision
+
+struct TypeInfo
+{
+ struct DecodableType
+ {
+ static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; }
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path);
+
+ Attributes::InstalledChimeSounds::TypeInfo::DecodableType installedChimeSounds;
+ Attributes::ActiveChimeSoundId::TypeInfo::DecodableType activeChimeSoundId = static_cast<uint8_t>(0);
+ Attributes::Enabled::TypeInfo::DecodableType enabled = static_cast<bool>(0);
+ Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList;
+ Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList;
+ Attributes::EventList::TypeInfo::DecodableType eventList;
+ Attributes::AttributeList::TypeInfo::DecodableType attributeList;
+ Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast<uint32_t>(0);
+ Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast<uint16_t>(0);
+ };
+};
+} // namespace Attributes
+} // namespace Chime
namespace EcosystemInformation {
namespace Structs {
namespace DeviceTypeStruct = Clusters::detail::Structs::DeviceTypeStruct;
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
index 20e4ea7..a7703bd 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
@@ -7313,6 +7313,48 @@
} // namespace Attributes
} // namespace ContentAppObserver
+namespace Chime {
+namespace Attributes {
+
+namespace InstalledChimeSounds {
+static constexpr AttributeId Id = 0x00000000;
+} // namespace InstalledChimeSounds
+
+namespace ActiveChimeSoundId {
+static constexpr AttributeId Id = 0x00000001;
+} // namespace ActiveChimeSoundId
+
+namespace Enabled {
+static constexpr AttributeId Id = 0x00000002;
+} // namespace Enabled
+
+namespace GeneratedCommandList {
+static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id;
+} // namespace GeneratedCommandList
+
+namespace AcceptedCommandList {
+static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id;
+} // namespace AcceptedCommandList
+
+namespace EventList {
+static constexpr AttributeId Id = Globals::Attributes::EventList::Id;
+} // namespace EventList
+
+namespace AttributeList {
+static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id;
+} // namespace AttributeList
+
+namespace FeatureMap {
+static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id;
+} // namespace FeatureMap
+
+namespace ClusterRevision {
+static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id;
+} // namespace ClusterRevision
+
+} // namespace Attributes
+} // namespace Chime
+
namespace EcosystemInformation {
namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h
index 26dd82c..688110c 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h
@@ -376,6 +376,9 @@
namespace ContentAppObserver {
static constexpr ClusterId Id = 0x00000510;
} // namespace ContentAppObserver
+namespace Chime {
+static constexpr ClusterId Id = 0x00000556;
+} // namespace Chime
namespace EcosystemInformation {
static constexpr ClusterId Id = 0x00000750;
} // namespace EcosystemInformation
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
index b6cd815..b6c40f7 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
@@ -1803,6 +1803,16 @@
} // namespace Commands
} // namespace ContentAppObserver
+namespace Chime {
+namespace Commands {
+
+namespace PlayChimeSound {
+static constexpr CommandId Id = 0x00000000;
+} // namespace PlayChimeSound
+
+} // namespace Commands
+} // namespace Chime
+
namespace CommissionerControl {
namespace Commands {
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 2333130..eb8fe22 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -152,6 +152,7 @@
| AccountLogin | 0x050E |
| ContentControl | 0x050F |
| ContentAppObserver | 0x0510 |
+| Chime | 0x0556 |
| EcosystemInformation | 0x0750 |
| CommissionerControl | 0x0751 |
| UnitTesting | 0xFFF1FC05|
@@ -13646,6 +13647,62 @@
};
/*----------------------------------------------------------------------------*\
+| Cluster Chime | 0x0556 |
+|------------------------------------------------------------------------------|
+| Commands: | |
+| * PlayChimeSound | 0x00 |
+|------------------------------------------------------------------------------|
+| Attributes: | |
+| * InstalledChimeSounds | 0x0000 |
+| * ActiveChimeSoundId | 0x0001 |
+| * Enabled | 0x0002 |
+| * GeneratedCommandList | 0xFFF8 |
+| * AcceptedCommandList | 0xFFF9 |
+| * EventList | 0xFFFA |
+| * AttributeList | 0xFFFB |
+| * FeatureMap | 0xFFFC |
+| * ClusterRevision | 0xFFFD |
+|------------------------------------------------------------------------------|
+| Events: | |
+\*----------------------------------------------------------------------------*/
+
+/*
+ * Command PlayChimeSound
+ */
+class ChimePlayChimeSound : public ClusterCommand
+{
+public:
+ ChimePlayChimeSound(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("play-chime-sound", credsIssuerConfig)
+ {
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId,
+ commandId, endpointIds.at(0));
+ return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest);
+ }
+
+ CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId,
+ groupId);
+
+ return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest);
+ }
+
+private:
+ chip::app::Clusters::Chime::Commands::PlayChimeSound::Type mRequest;
+};
+
+/*----------------------------------------------------------------------------*\
| Cluster EcosystemInformation | 0x0750 |
|------------------------------------------------------------------------------|
| Commands: | |
@@ -26166,6 +26223,72 @@
commands.RegisterCluster(clusterName, clusterCommands);
}
+void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsIssuerConfig)
+{
+ using namespace chip::app::Clusters::Chime;
+
+ const char * clusterName = "Chime";
+
+ commands_list clusterCommands = {
+ //
+ // Commands
+ //
+ make_unique<ClusterCommand>(Id, credsIssuerConfig), //
+ make_unique<ChimePlayChimeSound>(credsIssuerConfig), //
+ //
+ // Attributes
+ //
+ make_unique<ReadAttribute>(Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), //
+ make_unique<ReadAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), //
+ make_unique<WriteAttribute<>>(Id, credsIssuerConfig), //
+ make_unique<
+ WriteAttributeAsComplex<chip::app::DataModel::List<const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type>>>(
+ Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, WriteCommandType::kForceWrite,
+ credsIssuerConfig), //
+ make_unique<WriteAttribute<uint8_t>>(Id, "active-chime-sound-id", 0, UINT8_MAX, Attributes::ActiveChimeSoundId::Id,
+ WriteCommandType::kWrite, credsIssuerConfig), //
+ make_unique<WriteAttribute<bool>>(Id, "enabled", 0, 1, Attributes::Enabled::Id, WriteCommandType::kWrite,
+ credsIssuerConfig), //
+ make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>(
+ Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite,
+ credsIssuerConfig), //
+ make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::CommandId>>>(
+ Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::EventId>>>(
+ Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<WriteAttributeAsComplex<chip::app::DataModel::List<const chip::AttributeId>>>(
+ Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<WriteAttribute<uint32_t>>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id,
+ WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<WriteAttribute<uint16_t>>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id,
+ WriteCommandType::kForceWrite, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), //
+ make_unique<SubscribeAttribute>(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), //
+ //
+ // Events
+ //
+ make_unique<ReadEvent>(Id, credsIssuerConfig), //
+ make_unique<SubscribeEvent>(Id, credsIssuerConfig), //
+ };
+
+ commands.RegisterCluster(clusterName, clusterCommands);
+}
void registerClusterEcosystemInformation(Commands & commands, CredentialIssuerCommands * credsIssuerConfig)
{
using namespace chip::app::Clusters::EcosystemInformation;
@@ -27028,6 +27151,7 @@
registerClusterAccountLogin(commands, credsIssuerConfig);
registerClusterContentControl(commands, credsIssuerConfig);
registerClusterContentAppObserver(commands, credsIssuerConfig);
+ registerClusterChime(commands, credsIssuerConfig);
registerClusterEcosystemInformation(commands, credsIssuerConfig);
registerClusterCommissionerControl(commands, credsIssuerConfig);
registerClusterUnitTesting(commands, credsIssuerConfig);
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
index 9a1062c..0c7234d 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp
@@ -5671,6 +5671,36 @@
ComplexArgumentParser::Finalize(request.ratingNameDesc);
}
+CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request,
+ Json::Value & value)
+{
+ VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);
+
+ // Copy to track which members we already processed.
+ Json::Value valueCopy(value);
+
+ ReturnErrorOnFailure(
+ ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.chimeId", "chimeId", value.isMember("chimeId")));
+ ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.name", "name", value.isMember("name")));
+
+ char labelWithMember[kMaxLabelLength];
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chimeId");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chimeId, value["chimeId"]));
+ valueCopy.removeMember("chimeId");
+
+ snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name");
+ ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"]));
+ valueCopy.removeMember("name");
+
+ return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
+}
+
+void ComplexArgumentParser::Finalize(chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request)
+{
+ ComplexArgumentParser::Finalize(request.chimeId);
+ ComplexArgumentParser::Finalize(request.name);
+}
+
CHIP_ERROR ComplexArgumentParser::Setup(const char * label,
chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request,
Json::Value & value)
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
index ccce33e..9089885 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h
@@ -658,6 +658,11 @@
static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request);
+static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request,
+ Json::Value & value);
+
+static void Finalize(chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request);
+
static CHIP_ERROR Setup(const char * label,
chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request,
Json::Value & value);
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index 05c1033..4d998a0 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -4997,6 +4997,31 @@
return CHIP_NO_ERROR;
}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = LogValue("ChimeId", indent + 1, value.chimeId);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeId'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = LogValue("Name", indent + 1, value.name);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+
CHIP_ERROR
DataModelLogger::LogValue(const char * label, size_t indent,
const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value)
@@ -17918,6 +17943,57 @@
}
break;
}
+ case Chime::Id: {
+ switch (path.mAttributeId)
+ {
+ case Chime::Attributes::InstalledChimeSounds::Id: {
+ chip::app::DataModel::DecodableList<chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("InstalledChimeSounds", 1, value);
+ }
+ case Chime::Attributes::ActiveChimeSoundId::Id: {
+ uint8_t value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("ActiveChimeSoundId", 1, value);
+ }
+ case Chime::Attributes::Enabled::Id: {
+ bool value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("Enabled", 1, value);
+ }
+ case Chime::Attributes::GeneratedCommandList::Id: {
+ chip::app::DataModel::DecodableList<chip::CommandId> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Chime::Id);
+ }
+ case Chime::Attributes::AcceptedCommandList::Id: {
+ chip::app::DataModel::DecodableList<chip::CommandId> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Chime::Id);
+ }
+ case Chime::Attributes::EventList::Id: {
+ chip::app::DataModel::DecodableList<chip::EventId> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("EventList", 1, value);
+ }
+ case Chime::Attributes::AttributeList::Id: {
+ chip::app::DataModel::DecodableList<chip::AttributeId> value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogAttributeId("AttributeList", 1, value, Chime::Id);
+ }
+ case Chime::Attributes::FeatureMap::Id: {
+ uint32_t value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("FeatureMap", 1, value);
+ }
+ case Chime::Attributes::ClusterRevision::Id: {
+ uint16_t value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("ClusterRevision", 1, value);
+ }
+ }
+ break;
+ }
case EcosystemInformation::Id: {
switch (path.mAttributeId)
{
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index 8ac710f..f880614 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -405,6 +405,9 @@
const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value);
+
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value);
static CHIP_ERROR
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp
index 73c5f1e..7eb6aaa 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp
@@ -259,6 +259,8 @@
return "ContentControl";
case chip::app::Clusters::ContentAppObserver::Id:
return "ContentAppObserver";
+ case chip::app::Clusters::Chime::Id:
+ return "Chime";
case chip::app::Clusters::EcosystemInformation::Id:
return "EcosystemInformation";
case chip::app::Clusters::CommissionerControl::Id:
@@ -4375,6 +4377,31 @@
return "Unknown";
}
}
+ case chip::app::Clusters::Chime::Id: {
+ switch (id)
+ {
+ case chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::Id:
+ return "InstalledChimeSounds";
+ case chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id:
+ return "ActiveChimeSoundId";
+ case chip::app::Clusters::Chime::Attributes::Enabled::Id:
+ return "Enabled";
+ case chip::app::Clusters::Chime::Attributes::GeneratedCommandList::Id:
+ return "GeneratedCommandList";
+ case chip::app::Clusters::Chime::Attributes::AcceptedCommandList::Id:
+ return "AcceptedCommandList";
+ case chip::app::Clusters::Chime::Attributes::EventList::Id:
+ return "EventList";
+ case chip::app::Clusters::Chime::Attributes::AttributeList::Id:
+ return "AttributeList";
+ case chip::app::Clusters::Chime::Attributes::FeatureMap::Id:
+ return "FeatureMap";
+ case chip::app::Clusters::Chime::Attributes::ClusterRevision::Id:
+ return "ClusterRevision";
+ default:
+ return "Unknown";
+ }
+ }
case chip::app::Clusters::EcosystemInformation::Id: {
switch (id)
{
@@ -5701,6 +5728,15 @@
return "Unknown";
}
}
+ case chip::app::Clusters::Chime::Id: {
+ switch (id)
+ {
+ case chip::app::Clusters::Chime::Commands::PlayChimeSound::Id:
+ return "PlayChimeSound";
+ default:
+ return "Unknown";
+ }
+ }
case chip::app::Clusters::CommissionerControl::Id: {
switch (id)
{
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
index 21b8385..f88caca 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -154,6 +154,7 @@
| AccountLogin | 0x050E |
| ContentControl | 0x050F |
| ContentAppObserver | 0x0510 |
+| Chime | 0x0556 |
| EcosystemInformation | 0x0750 |
| CommissionerControl | 0x0751 |
| UnitTesting | 0xFFF1FC05|
@@ -160032,6 +160033,922 @@
#endif // MTR_ENABLE_PROVISIONAL
#if MTR_ENABLE_PROVISIONAL
/*----------------------------------------------------------------------------*\
+| Cluster Chime | 0x0556 |
+|------------------------------------------------------------------------------|
+| Commands: | |
+| * PlayChimeSound | 0x00 |
+|------------------------------------------------------------------------------|
+| Attributes: | |
+| * InstalledChimeSounds | 0x0000 |
+| * ActiveChimeSoundId | 0x0001 |
+| * Enabled | 0x0002 |
+| * GeneratedCommandList | 0xFFF8 |
+| * AcceptedCommandList | 0xFFF9 |
+| * EventList | 0xFFFA |
+| * AttributeList | 0xFFFB |
+| * FeatureMap | 0xFFFC |
+| * ClusterRevision | 0xFFFD |
+|------------------------------------------------------------------------------|
+| Events: | |
+\*----------------------------------------------------------------------------*/
+
+#if MTR_ENABLE_PROVISIONAL
+/*
+ * Command PlayChimeSound
+ */
+class ChimePlayChimeSound : public ClusterCommand {
+public:
+ ChimePlayChimeSound()
+ : ClusterCommand("play-chime-sound")
+ {
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRChimeClusterPlayChimeSoundParams alloc] init];
+ params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ uint16_t repeatCount = mRepeatCount.ValueOr(1);
+ uint16_t __block responsesNeeded = repeatCount;
+ while (repeatCount--) {
+ [cluster playChimeSoundWithParams:params completion:
+ ^(NSError * _Nullable error) {
+ responsesNeeded--;
+ if (error != nil) {
+ mError = error;
+ LogNSError("Error", error);
+ RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error);
+ }
+ if (responsesNeeded == 0) {
+ SetCommandExitStatus(mError);
+ }
+ }];
+ }
+ return CHIP_NO_ERROR;
+ }
+
+private:
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute InstalledChimeSounds
+ */
+class ReadChimeInstalledChimeSounds : public ReadAttribute {
+public:
+ ReadChimeInstalledChimeSounds()
+ : ReadAttribute("installed-chime-sounds")
+ {
+ }
+
+ ~ReadChimeInstalledChimeSounds()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeInstalledChimeSoundsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.InstalledChimeSounds response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime InstalledChimeSounds read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeInstalledChimeSounds : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeInstalledChimeSounds()
+ : SubscribeAttribute("installed-chime-sounds")
+ {
+ }
+
+ ~SubscribeAttributeChimeInstalledChimeSounds()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeInstalledChimeSoundsWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.InstalledChimeSounds response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute ActiveChimeSoundId
+ */
+class ReadChimeActiveChimeSoundId : public ReadAttribute {
+public:
+ ReadChimeActiveChimeSoundId()
+ : ReadAttribute("active-chime-sound-id")
+ {
+ }
+
+ ~ReadChimeActiveChimeSoundId()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeActiveChimeSoundIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime ActiveChimeSoundId read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteChimeActiveChimeSoundId : public WriteAttribute {
+public:
+ WriteChimeActiveChimeSoundId()
+ : WriteAttribute("active-chime-sound-id")
+ {
+ AddArgument("attr-name", "active-chime-sound-id");
+ AddArgument("attr-value", 0, UINT8_MAX, &mValue);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteChimeActiveChimeSoundId()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue];
+
+ [cluster writeAttributeActiveChimeSoundIdWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("Chime ActiveChimeSoundId write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ uint8_t mValue;
+};
+
+class SubscribeAttributeChimeActiveChimeSoundId : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeActiveChimeSoundId()
+ : SubscribeAttribute("active-chime-sound-id")
+ {
+ }
+
+ ~SubscribeAttributeChimeActiveChimeSoundId()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeActiveChimeSoundIdWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute Enabled
+ */
+class ReadChimeEnabled : public ReadAttribute {
+public:
+ ReadChimeEnabled()
+ : ReadAttribute("enabled")
+ {
+ }
+
+ ~ReadChimeEnabled()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.Enabled response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime Enabled read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class WriteChimeEnabled : public WriteAttribute {
+public:
+ WriteChimeEnabled()
+ : WriteAttribute("enabled")
+ {
+ AddArgument("attr-name", "enabled");
+ AddArgument("attr-value", 0, 1, &mValue);
+ WriteAttribute::AddArguments();
+ }
+
+ ~WriteChimeEnabled()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRWriteParams alloc] init];
+ params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+ params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil;
+ NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue];
+
+ [cluster writeAttributeEnabledWithValue:value params:params completion:^(NSError * _Nullable error) {
+ if (error != nil) {
+ LogNSError("Chime Enabled write Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ bool mValue;
+};
+
+class SubscribeAttributeChimeEnabled : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeEnabled()
+ : SubscribeAttribute("enabled")
+ {
+ }
+
+ ~SubscribeAttributeChimeEnabled()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeEnabledWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.Enabled response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute GeneratedCommandList
+ */
+class ReadChimeGeneratedCommandList : public ReadAttribute {
+public:
+ ReadChimeGeneratedCommandList()
+ : ReadAttribute("generated-command-list")
+ {
+ }
+
+ ~ReadChimeGeneratedCommandList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::GeneratedCommandList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.GeneratedCommandList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime GeneratedCommandList read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeGeneratedCommandList : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeGeneratedCommandList()
+ : SubscribeAttribute("generated-command-list")
+ {
+ }
+
+ ~SubscribeAttributeChimeGeneratedCommandList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::GeneratedCommandList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeGeneratedCommandListWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.GeneratedCommandList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute AcceptedCommandList
+ */
+class ReadChimeAcceptedCommandList : public ReadAttribute {
+public:
+ ReadChimeAcceptedCommandList()
+ : ReadAttribute("accepted-command-list")
+ {
+ }
+
+ ~ReadChimeAcceptedCommandList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::AcceptedCommandList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.AcceptedCommandList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime AcceptedCommandList read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeAcceptedCommandList : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeAcceptedCommandList()
+ : SubscribeAttribute("accepted-command-list")
+ {
+ }
+
+ ~SubscribeAttributeChimeAcceptedCommandList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::AcceptedCommandList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeAcceptedCommandListWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.AcceptedCommandList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute EventList
+ */
+class ReadChimeEventList : public ReadAttribute {
+public:
+ ReadChimeEventList()
+ : ReadAttribute("event-list")
+ {
+ }
+
+ ~ReadChimeEventList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::EventList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.EventList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime EventList read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeEventList : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeEventList()
+ : SubscribeAttribute("event-list")
+ {
+ }
+
+ ~SubscribeAttributeChimeEventList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::EventList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeEventListWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.EventList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute AttributeList
+ */
+class ReadChimeAttributeList : public ReadAttribute {
+public:
+ ReadChimeAttributeList()
+ : ReadAttribute("attribute-list")
+ {
+ }
+
+ ~ReadChimeAttributeList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::AttributeList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.AttributeList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime AttributeList read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeAttributeList : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeAttributeList()
+ : SubscribeAttribute("attribute-list")
+ {
+ }
+
+ ~SubscribeAttributeChimeAttributeList()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::AttributeList::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeAttributeListWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.AttributeList response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute FeatureMap
+ */
+class ReadChimeFeatureMap : public ReadAttribute {
+public:
+ ReadChimeFeatureMap()
+ : ReadAttribute("feature-map")
+ {
+ }
+
+ ~ReadChimeFeatureMap()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::FeatureMap::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.FeatureMap response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime FeatureMap read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeFeatureMap : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeFeatureMap()
+ : SubscribeAttribute("feature-map")
+ {
+ }
+
+ ~SubscribeAttributeChimeFeatureMap()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::FeatureMap::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeFeatureMapWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.FeatureMap response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+
+/*
+ * Attribute ClusterRevision
+ */
+class ReadChimeClusterRevision : public ReadAttribute {
+public:
+ ReadChimeClusterRevision()
+ : ReadAttribute("cluster-revision")
+ {
+ }
+
+ ~ReadChimeClusterRevision()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ClusterRevision::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.ClusterRevision response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ LogNSError("Chime ClusterRevision read Error", error);
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+ return CHIP_NO_ERROR;
+ }
+};
+
+class SubscribeAttributeChimeClusterRevision : public SubscribeAttribute {
+public:
+ SubscribeAttributeChimeClusterRevision()
+ : SubscribeAttribute("cluster-revision")
+ {
+ }
+
+ ~SubscribeAttributeChimeClusterRevision()
+ {
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id;
+ constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ClusterRevision::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId);
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
+ if (mKeepSubscriptions.HasValue()) {
+ params.replaceExistingSubscriptions = !mKeepSubscriptions.Value();
+ }
+ if (mFabricFiltered.HasValue()) {
+ params.filterByFabric = mFabricFiltered.Value();
+ }
+ if (mAutoResubscribe.HasValue()) {
+ params.resubscribeAutomatically = mAutoResubscribe.Value();
+ }
+ [cluster subscribeAttributeClusterRevisionWithParams:params
+ subscriptionEstablished:^() { mSubscriptionEstablished = YES; }
+ reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
+ NSLog(@"Chime.ClusterRevision response %@", [value description]);
+ if (error == nil) {
+ RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);
+ } else {
+ RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error);
+ }
+ SetCommandExitStatus(error);
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+/*----------------------------------------------------------------------------*\
| Cluster EcosystemInformation | 0x0750 |
|------------------------------------------------------------------------------|
| Commands: | |
@@ -183018,6 +183935,64 @@
commands.RegisterCluster(clusterName, clusterCommands);
#endif // MTR_ENABLE_PROVISIONAL
}
+void registerClusterChime(Commands & commands)
+{
+#if MTR_ENABLE_PROVISIONAL
+ using namespace chip::app::Clusters::Chime;
+
+ const char * clusterName = "Chime";
+
+ commands_list clusterCommands = {
+ make_unique<ClusterCommand>(Id), //
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ChimePlayChimeSound>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+ make_unique<ReadAttribute>(Id), //
+ make_unique<WriteAttribute>(Id), //
+ make_unique<SubscribeAttribute>(Id), //
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeInstalledChimeSounds>(), //
+ make_unique<SubscribeAttributeChimeInstalledChimeSounds>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeActiveChimeSoundId>(), //
+ make_unique<WriteChimeActiveChimeSoundId>(), //
+ make_unique<SubscribeAttributeChimeActiveChimeSoundId>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeEnabled>(), //
+ make_unique<WriteChimeEnabled>(), //
+ make_unique<SubscribeAttributeChimeEnabled>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeGeneratedCommandList>(), //
+ make_unique<SubscribeAttributeChimeGeneratedCommandList>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeAcceptedCommandList>(), //
+ make_unique<SubscribeAttributeChimeAcceptedCommandList>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeEventList>(), //
+ make_unique<SubscribeAttributeChimeEventList>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeAttributeList>(), //
+ make_unique<SubscribeAttributeChimeAttributeList>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeFeatureMap>(), //
+ make_unique<SubscribeAttributeChimeFeatureMap>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<ReadChimeClusterRevision>(), //
+ make_unique<SubscribeAttributeChimeClusterRevision>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+ };
+
+ commands.RegisterCluster(clusterName, clusterCommands);
+#endif // MTR_ENABLE_PROVISIONAL
+}
void registerClusterEcosystemInformation(Commands & commands)
{
#if MTR_ENABLE_PROVISIONAL
@@ -183658,6 +184633,7 @@
registerClusterAccountLogin(commands);
registerClusterContentControl(commands);
registerClusterContentAppObserver(commands);
+ registerClusterChime(commands);
registerClusterEcosystemInformation(commands);
registerClusterCommissionerControl(commands);
registerClusterUnitTesting(commands);