Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MaxMeasuredValue is out of range Temperature Measurement Cluster #15821

Merged
merged 3 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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