Skip to content

Commit

Permalink
Update data model for pressure and flow clusters (#15259)
Browse files Browse the repository at this point in the history
* Per appclusters section 2.5.4 for flow measurement:
  * attributes are unsigned,
  * {,Min,Max}MeasuredValue attributes are nullable,
  * Fix min/max ranges per spec.
* Per appclusters section 2.4.5 for pressure measurement:
  * {,Min,Max}MeasuredValue and {,Min,Max}ScaledValue are nullable.
  • Loading branch information
dnicoara authored and pull[bot] committed Dec 14, 2023
1 parent 5edbb31 commit 1433100
Show file tree
Hide file tree
Showing 27 changed files with 1,403 additions and 411 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1339,9 +1339,9 @@ server cluster FixedLabel = 64 {
}

server cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
Expand Down Expand Up @@ -2527,9 +2527,9 @@ server cluster PowerSourceConfiguration = 46 {
}

server cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down
24 changes: 12 additions & 12 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ server cluster FixedLabel = 64 {
}

client cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down Expand Up @@ -694,16 +694,16 @@ server cluster OperationalCredentials = 62 {
}

client cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ server cluster FixedLabel = 64 {
}

client cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down Expand Up @@ -714,9 +714,9 @@ server cluster OperationalCredentials = 62 {
}

client cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down
12 changes: 6 additions & 6 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1263,9 +1263,9 @@ server cluster FixedLabel = 64 {
}

server cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down Expand Up @@ -2234,9 +2234,9 @@ server cluster OperationalCredentials = 62 {
}

server cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute int16u clusterRevision = 65533;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

private typealias ReadCallback = ChipClusters.IntegerAttributeCallback
private typealias PressureReadCallback =
ChipClusters.PressureMeasurementCluster.MeasuredValueAttributeCallback

class SensorClientFragment : Fragment() {
private lateinit var scope: CoroutineScope
Expand Down Expand Up @@ -251,11 +253,11 @@ class SensorClientFragment : Fragment() {
"unitSymbol" to "\u00B0C"
),
"Pressure" to mapOf(
"read" to { device: Long, endpointId: Int, callback: ReadCallback ->
"read" to { device: Long, endpointId: Int, callback: PressureReadCallback ->
val cluster = ChipClusters.PressureMeasurementCluster(device, endpointId)
cluster.readMeasuredValueAttribute(callback)
},
"subscribe" to { device: Long, endpointId: Int, callback: ReadCallback ->
"subscribe" to { device: Long, endpointId: Int, callback: PressureReadCallback ->
val cluster = ChipClusters.PressureMeasurementCluster(device, endpointId)
cluster.subscribeMeasuredValueAttribute(callback,
MIN_REFRESH_PERIOD_S,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ limitations under the License.
<define>FLOW_MEASUREMENT_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="FLOW_MEASURED_VALUE" type="INT16S" writable="false" optional="false">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="FLOW_MIN_MEASURED_VALUE" type="INT16S" min="-38221" max="65535" writable="false" optional="false">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="FLOW_MAX_MEASURED_VALUE" type="INT16S" min="-38221" max="65535" writable="false" optional="false">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0003" define="FLOW_TOLERANCE" type="INT16U" writable="false" default="0" optional="true">Tolerance</attribute>
<attribute side="server" code="0x0000" define="FLOW_MEASURED_VALUE" type="INT16U" writable="false" optional="false" isNullable="true">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="FLOW_MIN_MEASURED_VALUE" type="INT16U" writable="false" optional="false" isNullable="true">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="FLOW_MAX_MEASURED_VALUE" type="INT16U" writable="false" optional="false" isNullable="true">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0003" define="FLOW_TOLERANCE" type="INT16U" min="0x0000" max="0x0800" writable="false" default="0" optional="true">Tolerance</attribute>
</cluster>

</configurator>
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ limitations under the License.
<client tick="false" init="false">true</client>
<server tick="false" tickFrequency="half" init="false">true</server>
<globalAttribute side="either" code="0xFFFD" value="2"/>
<attribute side="server" code="0x0000" define="PRESSURE_MEASURED_VALUE" type="INT16S" writable="false" reportable="true" default="0x0000" optional="false">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="PRESSURE_MIN_MEASURED_VALUE" type="INT16S" writable="false" optional="false">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="PRESSURE_MAX_MEASURED_VALUE" type="INT16S" writable="false" optional="false">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0000" define="PRESSURE_MEASURED_VALUE" type="INT16S" writable="false" reportable="true" default="0x0000" optional="false" isNullable="true">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="PRESSURE_MIN_MEASURED_VALUE" type="INT16S" writable="false" optional="false" isNullable="true">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="PRESSURE_MAX_MEASURED_VALUE" type="INT16S" writable="false" optional="false" isNullable="true">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0003" define="PRESSURE_TOLERANCE" type="INT16U" min="0x0000" max="0x0800" writable="false" reportable="true" optional="true" default="0">Tolerance</attribute>
<attribute side="server" code="0x0010" define="PRESSURE_SCALED_VALUE" type="INT16S" writable="false" reportable="true" optional="true" default="0">ScaledValue</attribute>
<attribute side="server" code="0x0011" define="PRESSURE_MIN_SCALED_VALUE" type="INT16S" writable="false" optional="true" default="0">MinScaledValue</attribute>
<attribute side="server" code="0x0012" define="PRESSURE_MAX_SCALED_VALUE" type="INT16S" writable="false" optional="true" default="0">MaxScaledValue</attribute>
<attribute side="server" code="0x0010" define="PRESSURE_SCALED_VALUE" type="INT16S" writable="false" reportable="true" optional="true" default="0" isNullable="true">ScaledValue</attribute>
<attribute side="server" code="0x0011" define="PRESSURE_MIN_SCALED_VALUE" type="INT16S" writable="false" optional="true" default="0" isNullable="true">MinScaledValue</attribute>
<attribute side="server" code="0x0012" define="PRESSURE_MAX_SCALED_VALUE" type="INT16S" writable="false" optional="true" default="0" isNullable="true">MaxScaledValue</attribute>
<attribute side="server" code="0x0013" define="PRESSURE_SCALED_TOLERANCE" type="INT16U" min="0x0000" max="0x0800" writable="false" reportable="true" optional="true" default="0">ScaledTolerance</attribute>
<attribute side="server" code="0x0014" define="PRESSURE_SCALE" type="INT8S" writable="false" optional="true" default="0">Scale</attribute>
</cluster>
Expand Down
12 changes: 6 additions & 6 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,9 @@ client cluster FixedLabel = 64 {
}

client cluster FlowMeasurement = 1028 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute int16u tolerance = 3;
readonly global attribute command_id serverGeneratedCommandList[] = 65528;
readonly global attribute command_id clientGeneratedCommandList[] = 65529;
Expand Down Expand Up @@ -2913,9 +2913,9 @@ client cluster PowerSourceConfiguration = 46 {
}

client cluster PressureMeasurement = 1027 {
readonly attribute int16s measuredValue = 0;
readonly attribute int16s minMeasuredValue = 1;
readonly attribute int16s maxMeasuredValue = 2;
readonly attribute nullable int16s measuredValue = 0;
readonly attribute nullable int16s minMeasuredValue = 1;
readonly attribute nullable int16s maxMeasuredValue = 2;
readonly global attribute attrib_id attributeList[] = 65531;
readonly global attribute int16u clusterRevision = 65533;
}
Expand Down
90 changes: 66 additions & 24 deletions src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

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

Loading

0 comments on commit 1433100

Please sign in to comment.