From dbf376be71f0a291e1922c6209d917d3a3ab2253 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 19 May 2023 00:06:40 -0400 Subject: [PATCH] Try to fix java build by enabling RefrigeratorAlarm in controller-clusters.zap. --- src/app/zap_cluster_list.json | 2 +- .../data_model/controller-clusters.zap | 218 +++++++++++++++++- .../chip/devicecontroller/ChipClusters.java | 19 ++ .../devicecontroller/ClusterInfoMapping.java | 23 ++ .../python/chip/clusters/CHIPClusters.py | 73 ++++++ .../zap-generated/CHIPClientCallbacks.h | 8 + .../zap-generated/CHIPClusters.h | 9 + .../zap-generated/endpoint_config.h | 17 +- .../zap-generated/gen_config.h | 5 + 9 files changed, 365 insertions(+), 9 deletions(-) diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 368e1d9d430838..eb9c236e7c369e 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -74,7 +74,7 @@ "pump-configuration-and-control-client" ], "PWM_CLUSTER": [], - "REFRIGERATOR_ALARM_CLUSTER": [], + "REFRIGERATOR_ALARM": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], "SCENES_CLUSTER": [], "SMOKE_CO_ALARM_CLUSTER": [], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index d52d30e81ac43c..ae71d90be8fb73 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -10276,6 +10276,212 @@ } ] }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Reset", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Latch", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Air Quality", "code": 91, diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index cf20ee7af0a81a..9509b55b339371 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -14138,6 +14138,25 @@ public RefrigeratorAlarmCluster(long devicePtr, int endpointId) { @Override public native long initWithDevice(long devicePtr, int endpointId); + public void reset(DefaultClusterCallback callback, Long alarms, Optional mask) { + reset(chipClusterPtr, callback, alarms, mask, null); + } + + public void reset( + DefaultClusterCallback callback, + Long alarms, + Optional mask, + int timedInvokeTimeoutMs) { + reset(chipClusterPtr, callback, alarms, mask, timedInvokeTimeoutMs); + } + + private native void reset( + long chipClusterPtr, + DefaultClusterCallback Callback, + Long alarms, + Optional mask, + @Nullable Integer timedInvokeTimeoutMs); + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index e4c69fcfd80090..71e67245b8e6ab 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -18230,6 +18230,29 @@ public Map> getCommandMap() { new LinkedHashMap<>(); commandMap.put("temperatureControl", temperatureControlClusterInteractionInfoMap); Map refrigeratorAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); + Map refrigeratorAlarmresetCommandParams = + new LinkedHashMap(); + CommandParameterInfo refrigeratorAlarmresetalarmsCommandParameterInfo = + new CommandParameterInfo("alarms", Long.class, Long.class); + refrigeratorAlarmresetCommandParams.put( + "alarms", refrigeratorAlarmresetalarmsCommandParameterInfo); + + CommandParameterInfo refrigeratorAlarmresetmaskCommandParameterInfo = + new CommandParameterInfo("mask", Optional.class, Long.class); + refrigeratorAlarmresetCommandParams.put("mask", refrigeratorAlarmresetmaskCommandParameterInfo); + + InteractionInfo refrigeratorAlarmresetInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RefrigeratorAlarmCluster) cluster) + .reset( + (DefaultClusterCallback) callback, + (Long) commandArguments.get("alarms"), + (Optional) commandArguments.get("mask")); + }, + () -> new DelegatedDefaultClusterCallback(), + refrigeratorAlarmresetCommandParams); + refrigeratorAlarmClusterInteractionInfoMap.put("reset", refrigeratorAlarmresetInteractionInfo); commandMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInteractionInfoMap); Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("airQuality", airQualityClusterInteractionInfoMap); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index b81327408a5a33..e48902e1913501 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3976,6 +3976,77 @@ class ChipClusters: }, }, } + _REFRIGERATOR_ALARM_CLUSTER_INFO = { + "clusterName": "RefrigeratorAlarm", + "clusterId": 0x00000057, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Reset", + "args": { + "alarms": "int", + "mask": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "Mask", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000001: { + "attributeName": "Latch", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "State", + "attributeId": 0x00000002, + "type": "int", + "reportable": 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, + }, + }, + } _AIR_QUALITY_CLUSTER_INFO = { "clusterName": "AirQuality", "clusterId": 0x0000005B, @@ -10289,6 +10360,7 @@ class ChipClusters: 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, + 0x00000057: _REFRIGERATOR_ALARM_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, @@ -10372,6 +10444,7 @@ class ChipClusters: "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, + "RefrigeratorAlarm": _REFRIGERATOR_ALARM_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h index 01c46405758d23..3da35cb736de71 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -427,6 +427,14 @@ typedef void (*ModeSelectEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RefrigeratorAlarmAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAcceptedCommandListListAttributeCallback)( diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h index db17098cf93914..3397e837abf11f 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/CHIPClusters.h @@ -375,6 +375,15 @@ class DLL_EXPORT ModeSelectCluster : public ClusterBase ~ModeSelectCluster() {} }; +class DLL_EXPORT RefrigeratorAlarmCluster : public ClusterBase +{ +public: + RefrigeratorAlarmCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, endpoint) + {} + ~RefrigeratorAlarmCluster() {} +}; + class DLL_EXPORT AirQualityCluster : public ClusterBase { public: diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h index 345ab29adbfc03..c71929f8951104 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/endpoint_config.h @@ -59,7 +59,7 @@ #define GENERATED_FUNCTION_ARRAYS // This is an array of EmberAfCluster structures. -#define GENERATED_CLUSTER_COUNT 80 +#define GENERATED_CLUSTER_COUNT 81 // clang-format off #define GENERATED_CLUSTERS { \ { \ @@ -543,6 +543,19 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ + { \ + /* Endpoint: 1, Cluster: Refrigerator Alarm (client) */ \ + .clusterId = 0x00000057, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr, \ + .generatedCommandList = nullptr, \ + .eventList = nullptr, \ + .eventCount = 0, \ + },\ { \ /* Endpoint: 1, Cluster: Air Quality (client) */ \ .clusterId = 0x0000005B, \ @@ -1111,7 +1124,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 80, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 81, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h index a7f94ba50a2fdf..7a1fca8e0d30f3 100644 --- a/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/darwin/controller-clusters/zap-generated/gen_config.h @@ -58,6 +58,7 @@ #define EMBER_AF_BOOLEAN_STATE_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ICD_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_MODE_SELECT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_REFRIGERATOR_ALARM_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_AIR_QUALITY_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_SMOKE_CO_ALARM_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_HEPA_FILTER_MONITORING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -252,6 +253,10 @@ #define ZCL_USING_MODE_SELECT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_MODE_SELECT_CLIENT +// Use this macro to check if the client side of the Refrigerator Alarm cluster is included +#define ZCL_USING_REFRIGERATOR_ALARM_CLIENT +#define EMBER_AF_PLUGIN_REFRIGERATOR_ALARM_CLIENT + // Use this macro to check if the client side of the Air Quality cluster is included #define ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_AIR_QUALITY_CLIENT