Skip to content

Commit

Permalink
Addressed review comments and zap generated
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed May 18, 2023
1 parent e1367bc commit cffeed4
Show file tree
Hide file tree
Showing 31 changed files with 3,194 additions and 1,878 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ limitations under the License.
<define>TEMPERATURE_CONTROL_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="TEMP_SETPOINT" type="INT16S" min="0x8000" max="0x7fff" writable="false" optional="true">TemperatureSetpoint</attribute>
<attribute side="server" code="0x0001" define="MIN_TEMP" type="INT16S" min="0x8000" max="0x7ffe" writable="false" optional="true">MinTemperature</attribute>
<attribute side="server" code="0x0002" define="MAX_TEMP" type="INT16S" min="0x8001" max="0x7fff" writable="false" optional="true">MaxTemperature</attribute>
<attribute side="server" code="0x0000" define="TEMP_SETPOINT" type="INT16S" writable="false" optional="true">TemperatureSetpoint</attribute>
<attribute side="server" code="0x0001" define="MIN_TEMP" type="INT16S" writable="false" optional="true">MinTemperature</attribute>
<attribute side="server" code="0x0002" define="MAX_TEMP" type="INT16S" writable="false" optional="true">MaxTemperature</attribute>
<attribute side="server" code="0x0003" define="STEP" type="INT16S" writable="false" optional="true">Step</attribute>
<attribute side="server" code="0x0004" define="CURRENT_TEMP_LEVEL_IND" type="INT8U" min="0x00" max="0x1f" writable="false" optional="true">CurrentTemperatureLevelIndex</attribute>
<attribute side="server" code="0x0004" define="CURRENT_TEMP_LEVEL_IND" type="INT8U" writable="false" optional="true">CurrentTemperatureLevelIndex</attribute>
<attribute side="server" code="0x0005" define="SUPPORTED_TEMP_LEVELS" type="ARRAY" entryType="TemperatureLevelStruct" writable="false" optional="true">SupportedTemperatureLevels</attribute>

<command source="client" code="00" name="SetTemperature" optional="false">
<command source="client" code="0x00" name="SetTemperature" optional="false">
<description>Set Temperature</description>
<arg name="TargetTemperature" type="INT16S" min="MIN_TEMP" max="MAX_TEMP"/>
<arg name="TargetTemperatureLevel" type="INT8U" />
<arg name="TargetTemperature" type="INT16S" min="MIN_TEMP" max="MAX_TEMP" optional="true"/>
<arg name="TargetTemperatureLevel" type="INT8U" optional="true"/>
</command>
</cluster>
<bitmap name="TemperatureControlFeature" type="BITMAP32">
Expand Down
34 changes: 34 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,40 @@ client cluster ModeSelect = 80 {
command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0;
}

/** Attributes and commands for configuring the temperature control, and reporting temperature. */
client cluster TemperatureControl = 86 {
bitmap TemperatureControlFeature : BITMAP32 {
kTemperatureNumber = 0x1;
kTemperatureLevel = 0x2;
}

struct TemperatureLevelStruct {
char_string<64> label = 0;
int8u tempLevel = 1;
}

readonly attribute optional int16s temperatureSetpoint = 0;
readonly attribute optional int16s minTemperature = 1;
readonly attribute optional int16s maxTemperature = 2;
readonly attribute optional int16s step = 3;
readonly attribute optional int8u currentTemperatureLevelIndex = 4;
readonly attribute optional TemperatureLevelStruct supportedTemperatureLevels[] = 5;
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;

request struct SetTemperatureRequest {
optional INT16S targetTemperature = 0;
optional INT8U targetTemperatureLevel = 1;
}

/** Set Temperature */
command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0;
}

/** Attributes for reporting air quality classification */
client cluster AirQuality = 91 {
enum AirQualityEnum : ENUM8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7779,6 +7779,185 @@ private static Map<String, InteractionInfo> readModeSelectInteractionInfo() {
return result;
}

private static Map<String, InteractionInfo> readTemperatureControlInteractionInfo() {
Map<String, InteractionInfo> result = new LinkedHashMap<>();
Map<String, CommandParameterInfo> readTemperatureControlTemperatureSetpointCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlTemperatureSetpointAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readTemperatureSetpointAttribute(
(ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlTemperatureSetpointCommandParams);
result.put(
"readTemperatureSetpointAttribute",
readTemperatureControlTemperatureSetpointAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlMinTemperatureCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlMinTemperatureAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readMinTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlMinTemperatureCommandParams);
result.put(
"readMinTemperatureAttribute",
readTemperatureControlMinTemperatureAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlMaxTemperatureCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlMaxTemperatureAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readMaxTemperatureAttribute((ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlMaxTemperatureCommandParams);
result.put(
"readMaxTemperatureAttribute",
readTemperatureControlMaxTemperatureAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlStepCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlStepAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readStepAttribute((ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlStepCommandParams);
result.put("readStepAttribute", readTemperatureControlStepAttributeInteractionInfo);
Map<String, CommandParameterInfo>
readTemperatureControlCurrentTemperatureLevelIndexCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlCurrentTemperatureLevelIndexAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readCurrentTemperatureLevelIndexAttribute(
(ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlCurrentTemperatureLevelIndexCommandParams);
result.put(
"readCurrentTemperatureLevelIndexAttribute",
readTemperatureControlCurrentTemperatureLevelIndexAttributeInteractionInfo);
Map<String, CommandParameterInfo>
readTemperatureControlSupportedTemperatureLevelsCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlSupportedTemperatureLevelsAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readSupportedTemperatureLevelsAttribute(
(ChipClusters.TemperatureControlCluster
.SupportedTemperatureLevelsAttributeCallback)
callback);
},
() ->
new ClusterInfoMapping
.DelegatedTemperatureControlClusterSupportedTemperatureLevelsAttributeCallback(),
readTemperatureControlSupportedTemperatureLevelsCommandParams);
result.put(
"readSupportedTemperatureLevelsAttribute",
readTemperatureControlSupportedTemperatureLevelsAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlGeneratedCommandListCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlGeneratedCommandListAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readGeneratedCommandListAttribute(
(ChipClusters.TemperatureControlCluster.GeneratedCommandListAttributeCallback)
callback);
},
() ->
new ClusterInfoMapping
.DelegatedTemperatureControlClusterGeneratedCommandListAttributeCallback(),
readTemperatureControlGeneratedCommandListCommandParams);
result.put(
"readGeneratedCommandListAttribute",
readTemperatureControlGeneratedCommandListAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlAcceptedCommandListCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlAcceptedCommandListAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readAcceptedCommandListAttribute(
(ChipClusters.TemperatureControlCluster.AcceptedCommandListAttributeCallback)
callback);
},
() ->
new ClusterInfoMapping
.DelegatedTemperatureControlClusterAcceptedCommandListAttributeCallback(),
readTemperatureControlAcceptedCommandListCommandParams);
result.put(
"readAcceptedCommandListAttribute",
readTemperatureControlAcceptedCommandListAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlEventListCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlEventListAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readEventListAttribute(
(ChipClusters.TemperatureControlCluster.EventListAttributeCallback) callback);
},
() ->
new ClusterInfoMapping
.DelegatedTemperatureControlClusterEventListAttributeCallback(),
readTemperatureControlEventListCommandParams);
result.put("readEventListAttribute", readTemperatureControlEventListAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlAttributeListCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlAttributeListAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readAttributeListAttribute(
(ChipClusters.TemperatureControlCluster.AttributeListAttributeCallback)
callback);
},
() ->
new ClusterInfoMapping
.DelegatedTemperatureControlClusterAttributeListAttributeCallback(),
readTemperatureControlAttributeListCommandParams);
result.put(
"readAttributeListAttribute", readTemperatureControlAttributeListAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlFeatureMapCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlFeatureMapAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedLongAttributeCallback(),
readTemperatureControlFeatureMapCommandParams);
result.put("readFeatureMapAttribute", readTemperatureControlFeatureMapAttributeInteractionInfo);
Map<String, CommandParameterInfo> readTemperatureControlClusterRevisionCommandParams =
new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo readTemperatureControlClusterRevisionAttributeInteractionInfo =
new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.TemperatureControlCluster) cluster)
.readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback);
},
() -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(),
readTemperatureControlClusterRevisionCommandParams);
result.put(
"readClusterRevisionAttribute",
readTemperatureControlClusterRevisionAttributeInteractionInfo);

return result;
}

private static Map<String, InteractionInfo> readAirQualityInteractionInfo() {
Map<String, InteractionInfo> result = new LinkedHashMap<>();
Map<String, CommandParameterInfo> readAirQualityAirQualityCommandParams =
Expand Down Expand Up @@ -19524,6 +19703,7 @@ public Map<String, Map<String, InteractionInfo>> getReadAttributeMap() {
put("booleanState", readBooleanStateInteractionInfo());
put("icdManagement", readIcdManagementInteractionInfo());
put("modeSelect", readModeSelectInteractionInfo());
put("temperatureControl", readTemperatureControlInteractionInfo());
put("airQuality", readAirQualityInteractionInfo());
put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo());
put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ public Map<String, Map<String, InteractionInfo>> getWriteAttributeMap() {
writeModeSelectInteractionInfo.put(
"writeOnModeAttribute", writeModeSelectOnModeAttributeInteractionInfo);
writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo);
Map<String, InteractionInfo> writeTemperatureControlInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("temperatureControl", writeTemperatureControlInteractionInfo);
Map<String, InteractionInfo> writeAirQualityInteractionInfo = new LinkedHashMap<>();
writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo);
Map<String, InteractionInfo> writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>();
Expand Down
Loading

0 comments on commit cffeed4

Please sign in to comment.