Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also remove references of bitmap24. Those were removed from the spec
Browse files Browse the repository at this point in the history
andy31415 committed Dec 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 84ad8d1 commit 32f1042
Showing 4 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -164,7 +164,6 @@ def is_struct(self) -> bool:
# Data types, held by ZAP in chip-types.xml and generally by the spec.
__CHIP_SIZED_TYPES__ = {
"bitmap16": BasicInteger(idl_name="bitmap16", byte_count=2, is_signed=False),
"bitmap24": BasicInteger(idl_name="bitmap24", byte_count=3, is_signed=False),
"bitmap32": BasicInteger(idl_name="bitmap32", byte_count=4, is_signed=False),
"bitmap64": BasicInteger(idl_name="bitmap64", byte_count=8, is_signed=False),
"bitmap8": BasicInteger(idl_name="bitmap8", byte_count=1, is_signed=False),
@@ -346,7 +345,7 @@ def is_struct_type(self, name: str):

def is_untyped_bitmap_type(self, name: str):
"""Determine if the given type is a untyped bitmap (just an interger size)."""
return name.lower() in {"bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64"}
return name.lower() in {"bitmap8", "bitmap16", "bitmap32", "bitmap64"}

def is_bitmap_type(self, name: str):
"""
@@ -386,7 +385,7 @@ def ParseDataType(data_type: DataType, lookup: TypeLookupContext) -> Union[Basic
return BasicString(idl_name=lowercase_name, is_binary=True, max_length=data_type.max_length)
elif lowercase_name in ['enum8', 'enum16']:
return IdlEnumType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name])
elif lowercase_name in ['bitmap8', 'bitmap16', 'bitmap24', 'bitmap32', 'bitmap64']:
elif lowercase_name in ['bitmap8', 'bitmap16', 'bitmap32', 'bitmap64']:
return IdlBitmapType(idl_name=lowercase_name, base_type=__CHIP_SIZED_TYPES__[lowercase_name])

int_type = __CHIP_SIZED_TYPES__.get(lowercase_name, None)
2 changes: 1 addition & 1 deletion scripts/py_matter_idl/matter_idl/test_supported_types.py
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ def testAllTypesSupported(self):
# handled as a non-integer type
"boolean", "single", "double",
# handled as specific bitmaps
"bitmap8", "bitmap16", "bitmap24", "bitmap32", "bitmap64",
"bitmap8", "bitmap16", "bitmap32", "bitmap64",
# handled as specific enums. Note that spec defines enumerations only for 8 and 16
"enum8", "enum16",

1 change: 0 additions & 1 deletion src/app/tests/suites/README.md
Original file line number Diff line number Diff line change
@@ -314,7 +314,6 @@ src/app/tests/suites/examples/gen_readme_example.sh
| boolean | 1 | BOOLEAN | 0x10 | Boolean | uint8_t |
| bitmap8 | 1 | BITMAP8 | 0x18 | 8-bit bitmap | uint8_t |
| bitmap16 | 2 | BITMAP16 | 0x19 | 16-bit bitmap | uint16_t |
| bitmap24 | 3 | BITMAP24 | 0x1A | 24-bit bitmap | uint32_t |
| bitmap32 | 4 | BITMAP32 | 0x1B | 32-bit bitmap | uint32_t |
| bitmap64 | 8 | BITMAP64 | 0x1F | 64-bit bitmap | uint8_t \* |
| int8u | 1 | INT8U | 0x20 | Unsigned 8-bit integer | uint8_t |
1 change: 0 additions & 1 deletion src/app/zap-templates/zcl/data-model/chip/chip-types.xml
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ limitations under the License.
<type id="0x10" description="Boolean" name="boolean" size="1" discrete="true" />
<type id="0x18" description="8-bit bitmap" name="bitmap8" size="1" discrete="true" />
<type id="0x19" description="16-bit bitmap" name="bitmap16" size="2" discrete="true" />
<type id="0x1A" description="24-bit bitmap" name="bitmap24" size="3" discrete="true" />
<type id="0x1B" description="32-bit bitmap" name="bitmap32" size="4" discrete="true" />
<type id="0x1F" description="64-bit bitmap" name="bitmap64" size="8" discrete="true" />
<type id="0x20" description="Unsigned 8-bit integer" name="int8u" size="1" analog="true" />

0 comments on commit 32f1042

Please sign in to comment.