diff --git a/src/app/zap-templates/partials/cluster-objects-struct.zapt b/src/app/zap-templates/partials/cluster-objects-struct.zapt index 8e502eb4f6e14e..6241a15be788e2 100644 --- a/src/app/zap-templates/partials/cluster-objects-struct.zapt +++ b/src/app/zap-templates/partials/cluster-objects-struct.zapt @@ -9,7 +9,7 @@ namespace {{asUpperCamelCase name}} { struct Type { public: {{#zcl_struct_items}} - {{zapTypeToEncodableClusterObjectType type}} {{asLowerCamelCase label}}; + {{zapTypeToEncodableClusterObjectType type}} {{asLowerCamelCase label}}{{> cluster_objects_field_init}}; {{/zcl_struct_items}} CHIP_ERROR Encode(TLV::TLVWriter &writer, TLV::Tag tag) const; @@ -27,7 +27,7 @@ namespace {{asUpperCamelCase name}} { struct DecodableType { public: {{#zcl_struct_items}} - {{zapTypeToDecodableClusterObjectType type}} {{asLowerCamelCase label}}; + {{zapTypeToDecodableClusterObjectType type}} {{asLowerCamelCase label}}{{> cluster_objects_field_init}}; {{/zcl_struct_items}} CHIP_ERROR Decode(TLV::TLVReader &reader); }; 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 58bd22d5af126a..df81935807ab3f 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 @@ -1799,9 +1799,9 @@ enum class Fields struct Type { public: - chip::ClusterId clusterId; - uint8_t length; - uint8_t value; + chip::ClusterId clusterId = static_cast(0); + uint8_t length = static_cast(0); + uint8_t value = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4543,10 +4543,10 @@ enum class Fields struct Type { public: - uint8_t powerProfileId; - uint8_t energyPhaseId; - bool powerProfileRemoteControl; - uint8_t powerProfileState; + uint8_t powerProfileId = static_cast(0); + uint8_t energyPhaseId = static_cast(0); + bool powerProfileRemoteControl = static_cast(0); + uint8_t powerProfileState = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4565,8 +4565,8 @@ enum class Fields struct Type { public: - uint8_t energyPhaseId; - uint16_t scheduledTime; + uint8_t energyPhaseId = static_cast(0); + uint16_t scheduledTime = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4589,12 +4589,12 @@ enum class Fields struct Type { public: - uint8_t energyPhaseId; - uint8_t macroPhaseId; - uint16_t expectedDuration; - uint16_t peakPower; - uint16_t energy; - uint16_t maxActivationDelay; + uint8_t energyPhaseId = static_cast(0); + uint8_t macroPhaseId = static_cast(0); + uint16_t expectedDuration = static_cast(0); + uint16_t peakPower = static_cast(0); + uint16_t energy = static_cast(0); + uint16_t maxActivationDelay = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -6119,8 +6119,8 @@ enum class Fields struct Type { public: - chip::DeviceTypeId type; - uint16_t revision; + chip::DeviceTypeId type = static_cast(0); + uint16_t revision = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -6448,9 +6448,9 @@ enum class Fields struct Type { public: - chip::FabricIndex fabricIndex; - Privilege privilege; - AuthMode authMode; + chip::FabricIndex fabricIndex = static_cast(0); + Privilege privilege = static_cast(0); + AuthMode authMode = static_cast(0); DataModel::Nullable> subjects; DataModel::Nullable> targets; @@ -6461,9 +6461,9 @@ struct Type struct DecodableType { public: - chip::FabricIndex fabricIndex; - Privilege privilege; - AuthMode authMode; + chip::FabricIndex fabricIndex = static_cast(0); + Privilege privilege = static_cast(0); + AuthMode authMode = static_cast(0); DataModel::Nullable> subjects; DataModel::Nullable> targets; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -6480,7 +6480,7 @@ enum class Fields struct Type { public: - chip::FabricIndex fabricIndex; + chip::FabricIndex fabricIndex = static_cast(0); chip::ByteSpan data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -6978,12 +6978,12 @@ enum class Fields struct Type { public: - uint16_t actionID; + uint16_t actionID = static_cast(0); chip::CharSpan name; - ActionTypeEnum type; - uint16_t endpointListID; - uint16_t supportedCommands; - ActionStateEnum status; + ActionTypeEnum type = static_cast(0); + uint16_t endpointListID = static_cast(0); + uint16_t supportedCommands = static_cast(0); + ActionStateEnum status = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -7004,9 +7004,9 @@ enum class Fields struct Type { public: - uint16_t endpointListID; + uint16_t endpointListID = static_cast(0); chip::CharSpan name; - EndpointListTypeEnum type; + EndpointListTypeEnum type = static_cast(0); DataModel::List endpoints; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -7015,9 +7015,9 @@ struct Type struct DecodableType { public: - uint16_t endpointListID; + uint16_t endpointListID = static_cast(0); chip::CharSpan name; - EndpointListTypeEnum type; + EndpointListTypeEnum type = static_cast(0); DataModel::DecodableList endpoints; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8542,9 +8542,9 @@ enum class Fields struct Type { public: - chip::FabricIndex fabricIndex; - chip::NodeId providerNodeID; - chip::EndpointId endpoint; + chip::FabricIndex fabricIndex = static_cast(0); + chip::NodeId providerNodeID = static_cast(0); + chip::EndpointId endpoint = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9606,7 +9606,7 @@ enum class Fields struct Type { public: - uint32_t failSafeExpiryLengthMs; + uint32_t failSafeExpiryLengthMs = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10016,7 +10016,7 @@ struct Type { public: chip::ByteSpan networkID; - bool connected; + bool connected = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10041,14 +10041,14 @@ enum class Fields struct Type { public: - uint64_t panId; - uint64_t extendedPanId; + uint64_t panId = static_cast(0); + uint64_t extendedPanId = static_cast(0); chip::CharSpan networkName; - uint16_t channel; - uint8_t version; - uint64_t extendedAddress; - int8_t rssi; - uint8_t lqi; + uint16_t channel = static_cast(0); + uint8_t version = static_cast(0); + uint64_t extendedAddress = static_cast(0); + int8_t rssi = static_cast(0); + uint8_t lqi = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10071,12 +10071,12 @@ enum class Fields struct Type { public: - uint8_t security; + uint8_t security = static_cast(0); chip::ByteSpan ssid; chip::ByteSpan bssid; - uint16_t channel; - WiFiBand wiFiBand; - int8_t rssi; + uint16_t channel = static_cast(0); + WiFiBand wiFiBand = static_cast(0); + int8_t rssi = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10907,11 +10907,11 @@ struct Type { public: chip::CharSpan name; - bool fabricConnected; - bool offPremiseServicesReachableIPv4; - bool offPremiseServicesReachableIPv6; + bool fabricConnected = static_cast(0); + bool offPremiseServicesReachableIPv4 = static_cast(0); + bool offPremiseServicesReachableIPv6 = static_cast(0); chip::ByteSpan hardwareAddress; - InterfaceType type; + InterfaceType type = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11239,7 +11239,7 @@ enum class Fields struct Type { public: - uint64_t id; + uint64_t id = static_cast(0); chip::CharSpan name; chip::ByteSpan faultRecording; @@ -11263,11 +11263,11 @@ enum class Fields struct Type { public: - uint64_t id; + uint64_t id = static_cast(0); chip::CharSpan name; - uint32_t stackFreeCurrent; - uint32_t stackFreeMinimum; - uint32_t stackSize; + uint32_t stackFreeCurrent = static_cast(0); + uint32_t stackFreeMinimum = static_cast(0); + uint32_t stackSize = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11518,20 +11518,20 @@ enum class Fields struct Type { public: - uint64_t extAddress; - uint32_t age; - uint16_t rloc16; - uint32_t linkFrameCounter; - uint32_t mleFrameCounter; - uint8_t lqi; - int8_t averageRssi; - int8_t lastRssi; - uint8_t frameErrorRate; - uint8_t messageErrorRate; - bool rxOnWhenIdle; - bool fullThreadDevice; - bool fullNetworkData; - bool isChild; + uint64_t extAddress = static_cast(0); + uint32_t age = static_cast(0); + uint16_t rloc16 = static_cast(0); + uint32_t linkFrameCounter = static_cast(0); + uint32_t mleFrameCounter = static_cast(0); + uint8_t lqi = static_cast(0); + int8_t averageRssi = static_cast(0); + int8_t lastRssi = static_cast(0); + uint8_t frameErrorRate = static_cast(0); + uint8_t messageErrorRate = static_cast(0); + bool rxOnWhenIdle = static_cast(0); + bool fullThreadDevice = static_cast(0); + bool fullNetworkData = static_cast(0); + bool isChild = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11560,18 +11560,18 @@ enum class Fields struct Type { public: - bool activeTimestampPresent; - bool pendingTimestampPresent; - bool masterKeyPresent; - bool networkNamePresent; - bool extendedPanIdPresent; - bool meshLocalPrefixPresent; - bool delayPresent; - bool panIdPresent; - bool channelPresent; - bool pskcPresent; - bool securityPolicyPresent; - bool channelMaskPresent; + bool activeTimestampPresent = static_cast(0); + bool pendingTimestampPresent = static_cast(0); + bool masterKeyPresent = static_cast(0); + bool networkNamePresent = static_cast(0); + bool extendedPanIdPresent = static_cast(0); + bool meshLocalPrefixPresent = static_cast(0); + bool delayPresent = static_cast(0); + bool panIdPresent = static_cast(0); + bool channelPresent = static_cast(0); + bool pskcPresent = static_cast(0); + bool securityPolicyPresent = static_cast(0); + bool channelMaskPresent = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11598,16 +11598,16 @@ enum class Fields struct Type { public: - uint64_t extAddress; - uint16_t rloc16; - uint8_t routerId; - uint8_t nextHop; - uint8_t pathCost; - uint8_t LQIIn; - uint8_t LQIOut; - uint8_t age; - bool allocated; - bool linkEstablished; + uint64_t extAddress = static_cast(0); + uint16_t rloc16 = static_cast(0); + uint8_t routerId = static_cast(0); + uint8_t nextHop = static_cast(0); + uint8_t pathCost = static_cast(0); + uint8_t LQIIn = static_cast(0); + uint8_t LQIOut = static_cast(0); + uint8_t age = static_cast(0); + bool allocated = static_cast(0); + bool linkEstablished = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11626,8 +11626,8 @@ enum class Fields struct Type { public: - uint16_t rotationTime; - uint16_t flags; + uint16_t rotationTime = static_cast(0); + uint16_t flags = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14311,11 +14311,11 @@ enum class Fields struct Type { public: - uint8_t fabricIndex; + uint8_t fabricIndex = static_cast(0); chip::ByteSpan rootPublicKey; - uint16_t vendorId; - chip::FabricId fabricId; - chip::NodeId nodeId; + uint16_t vendorId = static_cast(0); + chip::FabricId fabricId = static_cast(0); + chip::NodeId nodeId = static_cast(0); chip::CharSpan label; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -14335,7 +14335,7 @@ enum class Fields struct Type { public: - uint8_t fabricIndex; + uint8_t fabricIndex = static_cast(0); chip::ByteSpan noc; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -15005,8 +15005,8 @@ enum class Fields struct Type { public: - uint16_t fabricIndex; - uint16_t groupId; + uint16_t fabricIndex = static_cast(0); + uint16_t groupId = static_cast(0); DataModel::List endpoints; chip::CharSpan groupName; @@ -15016,8 +15016,8 @@ struct Type struct DecodableType { public: - uint16_t fabricIndex; - uint16_t groupId; + uint16_t fabricIndex = static_cast(0); + uint16_t groupId = static_cast(0); DataModel::DecodableList endpoints; chip::CharSpan groupName; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -15035,9 +15035,9 @@ enum class Fields struct Type { public: - chip::FabricIndex fabricIndex; - uint16_t groupId; - uint16_t groupKeySetID; + chip::FabricIndex fabricIndex = static_cast(0); + uint16_t groupId = static_cast(0); + uint16_t groupKeySetID = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -15063,14 +15063,14 @@ enum class Fields struct Type { public: - uint16_t groupKeySetID; - GroupKeySecurityPolicy securityPolicy; + uint16_t groupKeySetID = static_cast(0); + GroupKeySecurityPolicy securityPolicy = static_cast(0); chip::ByteSpan epochKey0; - uint64_t epochStartTime0; + uint64_t epochStartTime0 = static_cast(0); chip::ByteSpan epochKey1; - uint64_t epochStartTime1; + uint64_t epochStartTime1 = static_cast(0); chip::ByteSpan epochKey2; - uint64_t epochStartTime2; + uint64_t epochStartTime2 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -15856,8 +15856,8 @@ struct Type { public: chip::CharSpan label; - uint8_t mode; - uint32_t semanticTag; + uint8_t mode = static_cast(0); + uint32_t semanticTag = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -15876,8 +15876,8 @@ enum class Fields struct Type { public: - uint16_t mfgCode; - uint16_t value; + uint16_t mfgCode = static_cast(0); + uint16_t value = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -16583,8 +16583,8 @@ enum class Fields struct Type { public: - DlCredentialType credentialType; - uint16_t credentialIndex; + DlCredentialType credentialType = static_cast(0); + uint16_t credentialIndex = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -29166,8 +29166,8 @@ enum class Fields struct Type { public: - uint8_t zoneId; - chip::BitFlags zoneStatus; + uint8_t zoneId = static_cast(0); + chip::BitFlags zoneStatus = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -30305,8 +30305,8 @@ enum class Fields struct Type { public: - uint16_t majorNumber; - uint16_t minorNumber; + uint16_t majorNumber = static_cast(0); + uint16_t minorNumber = static_cast(0); chip::CharSpan name; chip::CharSpan callSign; chip::CharSpan affiliateCallSign; @@ -30333,7 +30333,7 @@ struct Type chip::CharSpan operatorName; chip::CharSpan lineupName; chip::CharSpan postalCode; - LineupInfoTypeEnum lineupInfoType; + LineupInfoTypeEnum lineupInfoType = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -30620,7 +30620,7 @@ enum class Fields struct Type { public: - uint8_t identifier; + uint8_t identifier = static_cast(0); chip::CharSpan name; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -30833,8 +30833,8 @@ enum class Fields struct Type { public: - uint64_t updatedAt; - uint64_t position; + uint64_t updatedAt = static_cast(0); + uint64_t position = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -31447,8 +31447,8 @@ enum class Fields struct Type { public: - uint8_t index; - InputTypeEnum inputType; + uint8_t index = static_cast(0); + InputTypeEnum inputType = static_cast(0); chip::CharSpan name; chip::CharSpan description; @@ -32091,9 +32091,9 @@ enum class Fields struct Type { public: - double width; - double height; - MetricTypeEnum metric; + double width = static_cast(0); + double height = static_cast(0); + MetricTypeEnum metric = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -32133,7 +32133,7 @@ enum class Fields struct Type { public: - ParameterEnum type; + ParameterEnum type = static_cast(0); chip::CharSpan value; DataModel::List externalIDList; @@ -32143,7 +32143,7 @@ struct Type struct DecodableType { public: - ParameterEnum type; + ParameterEnum type = static_cast(0); chip::CharSpan value; DataModel::DecodableList externalIDList; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -32468,8 +32468,8 @@ enum class Fields struct Type { public: - uint8_t index; - OutputTypeEnum outputType; + uint8_t index = static_cast(0); + OutputTypeEnum outputType = static_cast(0); chip::CharSpan name; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32680,7 +32680,7 @@ enum class Fields struct Type { public: - uint16_t catalogVendorId; + uint16_t catalogVendorId = static_cast(0); chip::CharSpan applicationId; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32975,7 +32975,7 @@ enum class Fields struct Type { public: - uint16_t catalogVendorId; + uint16_t catalogVendorId = static_cast(0); chip::CharSpan applicationId; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -33391,14 +33391,14 @@ enum class Fields struct Type { public: - uint8_t a; - bool b; - SimpleEnum c; + uint8_t a = static_cast(0); + bool b = static_cast(0); + SimpleEnum c = static_cast(0); chip::ByteSpan d; chip::CharSpan e; - chip::BitFlags f; - float g; - double h; + chip::BitFlags f = static_cast>(0); + float g = static_cast(0); + double h = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -33473,8 +33473,8 @@ enum class Fields struct Type { public: - uint8_t a; - bool b; + uint8_t a = static_cast(0); + bool b = static_cast(0); Structs::SimpleStruct::Type c; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -33499,8 +33499,8 @@ enum class Fields struct Type { public: - uint8_t a; - bool b; + uint8_t a = static_cast(0); + bool b = static_cast(0); Structs::SimpleStruct::Type c; DataModel::List d; DataModel::List e; @@ -33513,8 +33513,8 @@ struct Type struct DecodableType { public: - uint8_t a; - bool b; + uint8_t a = static_cast(0); + bool b = static_cast(0); Structs::SimpleStruct::DecodableType c; DataModel::DecodableList d; DataModel::DecodableList e; @@ -33556,7 +33556,7 @@ enum class Fields struct Type { public: - uint64_t fabricIndex; + uint64_t fabricIndex = static_cast(0); chip::ByteSpan operationalCert; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;