Skip to content

Commit

Permalink
Fix MaxMeasuredValue is out of range Temperature Measurement Cluster (#…
Browse files Browse the repository at this point in the history
…15821)

* Fix MaxMeasuredValue is out of range Temperature Measurement Cluster

* Make temperature attributes null if their value are unknown

* Run codegen
  • Loading branch information
yufengwangca authored and pull[bot] committed May 26, 2022
1 parent 33e77af commit 8edbe5b
Show file tree
Hide file tree
Showing 31 changed files with 646 additions and 191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2801,9 +2801,9 @@ server cluster TargetNavigator = 1285 {
}

server cluster TemperatureMeasurement = 1026 {
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 attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
Expand Down
12 changes: 6 additions & 6 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -870,16 +870,16 @@ server cluster Scenes = 5 {
}

client cluster TemperatureMeasurement = 1026 {
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 TemperatureMeasurement = 1026 {
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/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -870,16 +870,16 @@ server cluster Scenes = 5 {
}

client cluster TemperatureMeasurement = 1026 {
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 TemperatureMeasurement = 1026 {
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/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1304,17 +1304,17 @@ server cluster SoftwareDiagnostics = 52 {
}

client cluster TemperatureMeasurement = 1026 {
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 attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster TemperatureMeasurement = 1026 {
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 attribute int16u tolerance = 3;
readonly global attribute int16u clusterRevision = 65533;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,9 @@ server cluster SoftwareDiagnostics = 52 {
}

client cluster TemperatureMeasurement = 1026 {
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 @@ -611,9 +611,9 @@ server cluster SoftwareDiagnostics = 52 {
}

server cluster TemperatureMeasurement = 1026 {
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 @@ -2402,9 +2402,9 @@ client cluster TargetNavigator = 1285 {
}

server cluster TemperatureMeasurement = 1026 {
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 @@ -35,6 +35,8 @@ import kotlinx.coroutines.launch
private typealias ReadCallback = ChipClusters.IntegerAttributeCallback
private typealias PressureReadCallback =
ChipClusters.PressureMeasurementCluster.MeasuredValueAttributeCallback
private typealias TemperatureReadCallback =
ChipClusters.TemperatureMeasurementCluster.MeasuredValueAttributeCallback

class SensorClientFragment : Fragment() {
private lateinit var scope: CoroutineScope
Expand Down Expand Up @@ -241,11 +243,11 @@ class SensorClientFragment : Fragment() {
private const val MAX_DATA_POINTS = 60
private val CLUSTERS = mapOf(
"Temperature" to mapOf(
"read" to { device: Long, endpointId: Int, callback: ReadCallback ->
"read" to { device: Long, endpointId: Int, callback: TemperatureReadCallback ->
val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId)
cluster.readMeasuredValueAttribute(callback)
},
"subscribe" to { device: Long, endpointId: Int, callback: ReadCallback ->
"subscribe" to { device: Long, endpointId: Int, callback: TemperatureReadCallback ->
val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId)
cluster.subscribeMeasuredValueAttribute(callback,
MIN_REFRESH_PERIOD_S,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ limitations under the License.
<define>TEMP_MEASUREMENT_CLUSTER</define>
<client tick="false" init="false">true</client>
<server tick="false" init="false">true</server>
<attribute side="server" code="0x0000" define="TEMP_MEASURED_VALUE" type="INT16S" min="0x954d" max="0x7fff" writable="false" optional="false">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="TEMP_MIN_MEASURED_VALUE" type="INT16S" min="0x954d" max="0x7ffe" writable="false" default="0x8000" optional="false">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="TEMP_MAX_MEASURED_VALUE" type="INT16S" min="0x954e" max="0x7fff" writable="false" default="0x8000" optional="false">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0000" define="TEMP_MEASURED_VALUE" type="INT16S" min="0x954d" max="0x7fff" writable="false" isNullable="true" optional="false">MeasuredValue</attribute>
<attribute side="server" code="0x0001" define="TEMP_MIN_MEASURED_VALUE" type="INT16S" min="0x954d" max="0x7ffe" writable="false" isNullable="true" default="0x8000" optional="false">MinMeasuredValue</attribute>
<attribute side="server" code="0x0002" define="TEMP_MAX_MEASURED_VALUE" type="INT16S" min="0x954e" max="0x7fff" writable="false" isNullable="true" default="0x8000" optional="false">MaxMeasuredValue</attribute>
<attribute side="server" code="0x0003" define="TEMP_TOLERANCE" type="INT16U" min="0" max="0x8000" writable="false" default="0" optional="true">Tolerance</attribute>
</cluster>
</configurator>
6 changes: 3 additions & 3 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -3263,9 +3263,9 @@ client cluster TargetNavigator = 1285 {
}

client cluster TemperatureMeasurement = 1026 {
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 attribute int16u tolerance = 3;
readonly global attribute attrib_id attributeList[] = 65531;
readonly global attribute int16u clusterRevision = 65533;
Expand Down
45 changes: 33 additions & 12 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 8edbe5b

Please sign in to comment.