From f8b315034f53f648fe468df681cdad9adcb0efd7 Mon Sep 17 00:00:00 2001 From: Yunhan Wang Date: Tue, 7 Dec 2021 08:37:10 -0800 Subject: [PATCH] run codegen --- .../python/chip/clusters/Objects.py | 457 ++++++++++++++---- .../zap-generated/CHIPCommandPayloadsObjc.h | 12 + .../zap-generated/CHIPCommandPayloadsObjc.mm | 26 + .../zap-generated/IMClusterCommandHandler.cpp | 61 ++- .../app-common/zap-generated/callback.h | 11 + .../zap-generated/cluster-objects.cpp | 76 +++ .../zap-generated/cluster-objects.h | 80 +++ .../app-common/zap-generated/command-id.h | 2 + .../app-common/zap-generated/ids/Commands.h | 8 + 9 files changed, 638 insertions(+), 95 deletions(-) diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 084ed1d4f7fa02..4d751443b82917 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5523,8 +5523,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class StartUp(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0028 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0028 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5537,8 +5542,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ShutDown(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0028 - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0028 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5549,8 +5559,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class Leave(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0028 - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0028 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5561,8 +5576,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ReachableChanged(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0028 - event_id: typing.ClassVar[int] = 0x00000003 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0028 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5865,8 +5885,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class StateTransition(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x002A - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002A + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5885,8 +5910,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class VersionApplied(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x002A - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002A + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -5901,8 +5931,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class DownloadError(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x002A - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002A + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -7612,8 +7647,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class HardwareFaultChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0033 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0033 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -7628,8 +7668,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class RadioFaultChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0033 - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0033 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -7644,8 +7689,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class NetworkFaultChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0033 - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0033 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -7660,8 +7710,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class BootReason(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0033 - event_id: typing.ClassVar[int] = 0x00000003 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0033 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -7831,8 +7886,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class SoftwareFault(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0034 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0034 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -9044,8 +9104,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class ConnectionStatus(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0035 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0035 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -9350,8 +9415,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class Disconnection(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0036 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0036 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -9364,8 +9434,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class AssociationFailure(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0036 - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0036 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -9380,8 +9455,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ConnectionStatus(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0036 - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0036 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10075,8 +10155,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class SwitchLatched(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10089,8 +10174,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class InitialPress(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10103,8 +10193,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class LongPress(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10117,8 +10212,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ShortRelease(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000003 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10131,8 +10231,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class LongRelease(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000004 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10145,8 +10250,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class MultiPressOngoing(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000005 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000005 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -10161,8 +10271,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class MultiPressComplete(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x003B - event_id: typing.ClassVar[int] = 0x00000006 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003B + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000006 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -11110,8 +11225,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class StateChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0045 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0045 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -13200,8 +13320,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class DoorLockAlarm(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0101 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0101 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -13214,8 +13339,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class DoorStateChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0101 - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0101 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -13228,8 +13358,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class LockOperation(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0101 - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0101 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -13252,8 +13387,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class LockOperationError(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0101 - event_id: typing.ClassVar[int] = 0x00000003 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0101 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -13278,8 +13418,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class LockUserChange(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0101 - event_id: typing.ClassVar[int] = 0x00000004 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0101 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14555,8 +14700,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class SupplyVoltageLow(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000000 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14567,8 +14717,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class SupplyVoltageHigh(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14579,8 +14734,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class PowerMissingPhase(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000002 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14591,8 +14751,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class SystemPressureLow(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000003 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000003 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14603,8 +14768,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class SystemPressureHigh(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000004 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000004 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14615,8 +14785,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class DryRunning(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000005 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000005 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14627,8 +14802,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class MotorTemperatureHigh(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000006 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000006 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14639,8 +14819,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class PumpMotorFatalFailure(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000007 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000007 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14651,8 +14836,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ElectronicTemperatureHigh(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000008 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000008 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14663,8 +14853,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class PumpBlocked(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000009 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000009 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14675,8 +14870,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class SensorFailure(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000A + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000A @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14687,8 +14887,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ElectronicNonFatalFailure(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000B + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000B @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14699,8 +14904,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ElectronicFatalFailure(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000C + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000C @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14711,8 +14921,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class GeneralFault(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000D + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000D @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14723,8 +14938,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class Leakage(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000E + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000E @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14735,8 +14955,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class AirDetection(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x0000000F + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x0000000F @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -14747,8 +14972,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class TurbineOperation(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x0200 - event_id: typing.ClassVar[int] = 0x00000010 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0200 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000010 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: @@ -25123,6 +25353,21 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg1: 'typing.List[uint]' = field(default_factory=lambda: []) + @dataclass + class TestEmitTestEventResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x000A + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="value", Tag=0, Type=uint), + ]) + + value: 'uint' = 0 + @dataclass class TestNestedStructListArgumentRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050F @@ -25280,6 +25525,25 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg1: 'typing.Optional[bool]' = None + @dataclass + class TestEmitTestEventRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x0014 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="arg1", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="arg2", Tag=1, Type=TestCluster.Enums.SimpleEnum), + ClusterObjectFieldDescriptor(Label="arg3", Tag=2, Type=bool), + ]) + + arg1: 'uint' = 0 + arg2: 'TestCluster.Enums.SimpleEnum' = 0 + arg3: 'bool' = False + class Attributes: @dataclass @@ -26566,8 +26830,13 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Events: @dataclass class TestEvent(ClusterEventDescriptor): - cluster_id: typing.ClassVar[int] = 0x050F - event_id: typing.ClassVar[int] = 0x00000001 + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050F + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 6b12d34d2276e8..4f63d2f0d731d0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -1873,6 +1873,11 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPTestClusterClusterTestEmitTestEventResponseParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull value; +- (instancetype)init; +@end + @interface CHIPTestClusterClusterTestNestedStructListArgumentRequestParams : NSObject @property (strong, nonatomic) CHIPTestClusterClusterNestedStructList * _Nonnull arg1; - (instancetype)init; @@ -1925,6 +1930,13 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPTestClusterClusterTestEmitTestEventRequestParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull arg1; +@property (strong, nonatomic) NSNumber * _Nonnull arg2; +@property (strong, nonatomic) NSNumber * _Nonnull arg3; +- (instancetype)init; +@end + @interface CHIPMessagingClusterDisplayMessageParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull messageId; @property (strong, nonatomic) NSNumber * _Nonnull messageControl; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index a3d8818c065e56..1f7dd89c417f19 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -3989,6 +3989,17 @@ - (instancetype)init } @end +@implementation CHIPTestClusterClusterTestEmitTestEventResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _value = @(0); + } + return self; +} +@end + @implementation CHIPTestClusterClusterTestNestedStructListArgumentRequestParams - (instancetype)init { @@ -4101,6 +4112,21 @@ - (instancetype)init } @end +@implementation CHIPTestClusterClusterTestEmitTestEventRequestParams +- (instancetype)init +{ + if (self = [super init]) { + + _arg1 = @(0); + + _arg2 = @(0); + + _arg3 = @(0); + } + return self; +} +@end + @implementation CHIPMessagingClusterDisplayMessageParams - (instancetype)init { diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index 985d51a557aac6..dd5de60d663908 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -1447,7 +1447,57 @@ namespace OtaSoftwareUpdateProvider { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { - ReportCommandUnsupported(apCommandObj, aCommandPath); + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::ApplyUpdateRequest::Id: { + Commands::ApplyUpdateRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::NotifyUpdateApplied::Id: { + Commands::NotifyUpdateApplied::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = + emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::QueryImage::Id: { + Commands::QueryImage::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + ReportCommandUnsupported(apCommandObj, aCommandPath); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); + } } } // namespace OtaSoftwareUpdateProvider @@ -1796,6 +1846,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::TestEmitTestEventRequest::Id: { + Commands::TestEmitTestEventRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfTestClusterClusterTestEmitTestEventRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } case Commands::TestEnumsRequest::Id: { Commands::TestEnumsRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index b31e893698cac2..ab6e58b16454f1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -15216,6 +15216,11 @@ bool emberAfTestClusterClusterSimpleStructResponseCallback( bool emberAfTestClusterClusterTestListInt8UArgumentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestEmitTestEventResponse Command callback (from server) + */ +bool emberAfTestClusterClusterTestEmitTestEventResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + uint64_t value); /** * @brief Test Cluster Cluster TestNestedStructListArgumentRequest Command callback (from client) */ @@ -15270,6 +15275,12 @@ bool emberAfTestClusterClusterTimedInvokeRequestCallback( bool emberAfTestClusterClusterTestSimpleOptionalArgumentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestEmitTestEventRequest Command callback (from client) + */ +bool emberAfTestClusterClusterTestEmitTestEventRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::DecodableType & commandData); /** * @brief Messaging Cluster DisplayMessage Command callback (from server) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index eb75909b970501..b64561434561a3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -18214,6 +18214,40 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace TestListInt8UArgumentRequest. +namespace TestEmitTestEventResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestEmitTestEventResponse. namespace TestNestedStructListArgumentRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -18568,6 +18602,48 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace TestSimpleOptionalArgumentRequest. +namespace TestEmitTestEventRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArg1)), arg1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArg2)), arg2)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArg3)), arg3)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kArg1): + ReturnErrorOnFailure(DataModel::Decode(reader, arg1)); + break; + case to_underlying(Fields::kArg2): + ReturnErrorOnFailure(DataModel::Decode(reader, arg2)); + break; + case to_underlying(Fields::kArg3): + ReturnErrorOnFailure(DataModel::Decode(reader, arg3)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestEmitTestEventRequest. } // namespace Commands namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 73f6c3d1d9845d..ef1ce8586a52dc 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -30019,6 +30019,11 @@ struct Type; struct DecodableType; } // namespace TestListInt8UArgumentRequest +namespace TestEmitTestEventResponse { +struct Type; +struct DecodableType; +} // namespace TestEmitTestEventResponse + namespace TestNestedStructListArgumentRequest { struct Type; struct DecodableType; @@ -30064,6 +30069,11 @@ struct Type; struct DecodableType; } // namespace TestSimpleOptionalArgumentRequest +namespace TestEmitTestEventRequest { +struct Type; +struct DecodableType; +} // namespace TestEmitTestEventRequest + } // namespace Commands namespace Commands { @@ -30849,6 +30859,38 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestListInt8UArgumentRequest +namespace TestEmitTestEventResponse { +enum class Fields +{ + kValue = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestEmitTestEventResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + uint64_t value; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestEmitTestEventResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + uint64_t value; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestEmitTestEventResponse namespace TestNestedStructListArgumentRequest { enum class Fields { @@ -31169,6 +31211,44 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestSimpleOptionalArgumentRequest +namespace TestEmitTestEventRequest { +enum class Fields +{ + kArg1 = 0, + kArg2 = 1, + kArg3 = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestEmitTestEventRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + uint8_t arg1; + SimpleEnum arg2; + bool arg3; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::TestCluster::Commands::TestEmitTestEventResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestEmitTestEventRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + uint8_t arg1; + SimpleEnum arg2; + bool arg3; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestEmitTestEventRequest } // namespace Commands namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 9c27f255f11fa4..026a12742a8f66 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -456,6 +456,7 @@ #define ZCL_TEST_LIST_STRUCT_ARGUMENT_REQUEST_COMMAND_ID (0x09) #define ZCL_SIMPLE_STRUCT_RESPONSE_COMMAND_ID (0x09) #define ZCL_TEST_LIST_INT8_U_ARGUMENT_REQUEST_COMMAND_ID (0x0A) +#define ZCL_TEST_EMIT_TEST_EVENT_RESPONSE_COMMAND_ID (0x0A) #define ZCL_TEST_NESTED_STRUCT_LIST_ARGUMENT_REQUEST_COMMAND_ID (0x0B) #define ZCL_TEST_LIST_NESTED_STRUCT_LIST_ARGUMENT_REQUEST_COMMAND_ID (0x0C) #define ZCL_TEST_LIST_INT8_U_REVERSE_REQUEST_COMMAND_ID (0x0D) @@ -465,6 +466,7 @@ #define ZCL_SIMPLE_STRUCT_ECHO_REQUEST_COMMAND_ID (0x11) #define ZCL_TIMED_INVOKE_REQUEST_COMMAND_ID (0x12) #define ZCL_TEST_SIMPLE_OPTIONAL_ARGUMENT_REQUEST_COMMAND_ID (0x13) +#define ZCL_TEST_EMIT_TEST_EVENT_REQUEST_COMMAND_ID (0x14) // Commands for cluster: Messaging #define ZCL_DISPLAY_MESSAGE_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index b455c92ad3a917..fcb1790f1a92a2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1634,6 +1634,10 @@ namespace TestListInt8UArgumentRequest { static constexpr CommandId Id = 0x0000000A; } // namespace TestListInt8UArgumentRequest +namespace TestEmitTestEventResponse { +static constexpr CommandId Id = 0x0000000A; +} // namespace TestEmitTestEventResponse + namespace TestNestedStructListArgumentRequest { static constexpr CommandId Id = 0x0000000B; } // namespace TestNestedStructListArgumentRequest @@ -1670,6 +1674,10 @@ namespace TestSimpleOptionalArgumentRequest { static constexpr CommandId Id = 0x00000013; } // namespace TestSimpleOptionalArgumentRequest +namespace TestEmitTestEventRequest { +static constexpr CommandId Id = 0x00000014; +} // namespace TestEmitTestEventRequest + } // namespace Commands } // namespace TestCluster