Skip to content

Commit

Permalink
Add temperature type. (#26618)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 4, 2024
1 parent 64f0f4d commit 9f58ad7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions scripts/py_matter_idl/matter_idl/generators/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def is_struct(self) -> bool:
"status": BasicInteger(idl_name="status", byte_count=2, is_signed=False),
"systime_us": BasicInteger(idl_name="systime_us", byte_count=8, is_signed=False),
"systime_ms": BasicInteger(idl_name="systime_ms", byte_count=8, is_signed=False),
"temperature": BasicInteger(idl_name="temperature", byte_count=2, is_signed=True),
"tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False),
"trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False),
"vendor_id": BasicInteger(idl_name="vendor_id", byte_count=2, is_signed=False),
Expand Down
3 changes: 3 additions & 0 deletions src/app/util/ember-compatibility-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type)
"chip::NodeId is expected to be uint64_t, change this when necessary");
return ZCL_INT64U_ATTRIBUTE_TYPE;

case ZCL_TEMPERATURE_ATTRIBUTE_TYPE: // Temperature
return ZCL_INT16S_ATTRIBUTE_TYPE;

default:
return type;
}
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/common/override.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ function atomicType(arg)
case 'utc':
case 'elapsed_s':
return 'uint32_t';
case 'temperature':
return 'int16_t';
default:
throw 'not overriding';
}
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ limitations under the License.
<type id="0xE5" description="System Time Microseconds" name="systime_us" size="8" analog="true" />
<type id="0xD1" description="System Time Milliseconds" name="systime_ms" size="8" analog="true" />
<type id="0xD2" description="Elapsed Time Seconds" name="elapsed_s" size="4" analog="true" />
<type id="0xDB" description="Temperature" name="temperature" size="2" analog="true" />
<type id="0xE6" description="Percentage units 1%" name="percent" size="1" analog="true" />
<type id="0xE7" description="Percentage units 0.01%" name="percent100ths" size="2" analog="true" />
<type id="0xE8" description="Cluster ID" name="cluster_id" size="4" discrete="true" />
Expand Down

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

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

0 comments on commit 9f58ad7

Please sign in to comment.