From d717c2d463015e8bfd71b70af5c65e00852c1f9e Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 6 Jan 2022 06:10:19 -0800 Subject: [PATCH] Add missing parts in Time Format cluster (#13324) * Add missing parts in time format cluster * Run codegen --- .../chip/localization-time-format-cluster.xml | 34 +++-- .../python/chip/clusters/Objects.py | 73 ++++++++++ .../CHIP/zap-generated/CHIPCallbackBridge.mm | 106 +++++++++++++++ .../CHIPCallbackBridge_internal.h | 127 ++++++++++++++++++ .../app-common/zap-generated/attribute-id.h | 3 + .../zap-generated/attributes/Accessors.cpp | 62 +++++++++ .../zap-generated/attributes/Accessors.h | 10 ++ .../zap-generated/cluster-objects.cpp | 9 ++ .../zap-generated/cluster-objects.h | 61 +++++++++ .../app-common/zap-generated/ids/Attributes.h | 12 ++ 10 files changed, 489 insertions(+), 8 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/localization-time-format-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/localization-time-format-cluster.xml index 14b6811a1bbfe8..819c4baaf54375 100644 --- a/src/app/zap-templates/zcl/data-model/chip/localization-time-format-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/localization-time-format-cluster.xml @@ -16,8 +16,26 @@ limitations under the License. --> - - + + + + + + + + + + + + + + + + + + + + General Localization Time Format @@ -26,12 +44,12 @@ limitations under the License. true true Nodes should be expected to be deployed to any and all regions of the world. These global regions -may have differing preferences for how dates and times are conveyed. As such, Nodes that visually -or audibly convey time information need a mechanism by which they can be configured to use a -user’s preferred format. + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. - - - + HourFormat + CalendarType + SupportedCalendarTypes \ No newline at end of file diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index c4e864f8d31322..7404421eb2201c 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -7096,19 +7096,92 @@ class LocalizationTimeFormat(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ + ClusterObjectFieldDescriptor(Label="hourFormat", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="calendarType", Tag=0x00000001, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="supportedCalendarTypes", Tag=0x00000002, Type=typing.Optional[typing.List[LocalizationTimeFormat.Enums.CalendarType]]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) + hourFormat: 'uint' = None + calendarType: 'typing.Optional[uint]' = None + supportedCalendarTypes: 'typing.Optional[typing.List[LocalizationTimeFormat.Enums.CalendarType]]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None + class Enums: + class CalendarType(IntEnum): + kBuddhist = 0x00 + kChinese = 0x01 + kCoptic = 0x02 + kEthiopian = 0x03 + kGregorian = 0x04 + kHebrew = 0x05 + kIndian = 0x06 + kIslamic = 0x07 + kJapanese = 0x08 + kKorean = 0x09 + kPersian = 0x0A + kTaiwanese = 0x0B + + class HourFormat(IntEnum): + k12hr = 0x00 + k24hr = 0x01 + class Attributes: + @dataclass + class HourFormat(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class CalendarType(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SupportedCalendarTypes(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002C + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[LocalizationTimeFormat.Enums.CalendarType]]) + + value: 'typing.Optional[typing.List[LocalizationTimeFormat.Enums.CalendarType]]' = None + @dataclass class AttributeList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index dc1ce98fcc04cc..3db41dee7cd30f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -7286,6 +7286,112 @@ } } +void CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::LocalizationTimeFormat::CalendarType value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::LocalizationTimeFormat::HourFormat value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPLocalizationUnitClusterTempUnitAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::LocalizationUnit::TempUnit value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index c498fd3cb364af..64172a12ad4ffd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -203,6 +203,14 @@ typedef void (*OtaSoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCallb void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum); typedef void (*NullableOtaSoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*LocalizationTimeFormatClusterCalendarTypeAttributeCallback)( + void *, chip::app::Clusters::LocalizationTimeFormat::CalendarType); +typedef void (*NullableLocalizationTimeFormatClusterCalendarTypeAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*LocalizationTimeFormatClusterHourFormatAttributeCallback)(void *, + chip::app::Clusters::LocalizationTimeFormat::HourFormat); +typedef void (*NullableLocalizationTimeFormatClusterHourFormatAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*LocalizationUnitClusterTempUnitAttributeCallback)(void *, chip::app::Clusters::LocalizationUnit::TempUnit); typedef void (*NullableLocalizationUnitClusterTempUnitAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -6022,6 +6030,125 @@ class CHIPNullableOtaSoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCa SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::LocalizationTimeFormat::CalendarType value); +}; + +class CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge + : public CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge +{ +public: + CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge + : public CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge +{ +public: + CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableLocalizationTimeFormatClusterCalendarTypeAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::LocalizationTimeFormat::HourFormat value); +}; + +class CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge + : public CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge +{ +public: + CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge + : public CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge +{ +public: + CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableLocalizationTimeFormatClusterHourFormatAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPLocalizationUnitClusterTempUnitAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 1ffdf799e54ce5..7832f567f2e1cc 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -335,6 +335,9 @@ // Client attributes // Server attributes +#define ZCL_HOUR_FORMAT_ATTRIBUTE_ID (0x0000) +#define ZCL_CALENDAR_TYPE_ATTRIBUTE_ID (0x0001) +#define ZCL_SUPPORTED_CALENDAR_TYPES_ATTRIBUTE_ID (0x0002) // Attribute ids for cluster: Localization Unit diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 3d5a9ae4952b40..a4afbb65b66e2e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -6534,6 +6534,68 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace LocalizationTimeFormat { namespace Attributes { +namespace HourFormat { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace HourFormat + +namespace CalendarType { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace CalendarType + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 0ce1351af9c40e..f897f13e1af4ce 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1190,6 +1190,16 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace LocalizationTimeFormat { namespace Attributes { +namespace HourFormat { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace HourFormat + +namespace CalendarType { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace CalendarType + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); 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 fb89826bc8c921..8e9200bfb34abb 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 @@ -6359,6 +6359,15 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { + case Attributes::HourFormat::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, hourFormat)); + break; + case Attributes::CalendarType::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, calendarType)); + break; + case Attributes::SupportedCalendarTypes::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, supportedCalendarTypes)); + break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); break; 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 ce2838c525fd5b..3633883bc8495f 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 @@ -8886,9 +8886,67 @@ struct TypeInfo } // namespace Attributes } // namespace LocalizationConfiguration namespace LocalizationTimeFormat { +// Enum for CalendarType +enum class CalendarType : uint8_t +{ + kBuddhist = 0x00, + kChinese = 0x01, + kCoptic = 0x02, + kEthiopian = 0x03, + kGregorian = 0x04, + kHebrew = 0x05, + kIndian = 0x06, + kIslamic = 0x07, + kJapanese = 0x08, + kKorean = 0x09, + kPersian = 0x0A, + kTaiwanese = 0x0B, +}; +// Enum for HourFormat +enum class HourFormat : uint8_t +{ + k12hr = 0x00, + k24hr = 0x01, +}; namespace Attributes { +namespace HourFormat { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::LocalizationTimeFormat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HourFormat::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HourFormat +namespace CalendarType { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::LocalizationTimeFormat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CalendarType::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CalendarType +namespace SupportedCalendarTypes { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::LocalizationTimeFormat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedCalendarTypes::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedCalendarTypes namespace AttributeList { struct TypeInfo { @@ -8934,6 +8992,9 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + Attributes::HourFormat::TypeInfo::DecodableType hourFormat; + Attributes::CalendarType::TypeInfo::DecodableType calendarType; + Attributes::SupportedCalendarTypes::TypeInfo::DecodableType supportedCalendarTypes; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index d68608b0479683..b2ecc54c1e0c84 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -1120,6 +1120,18 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace LocalizationTimeFormat { namespace Attributes { +namespace HourFormat { +static constexpr AttributeId Id = 0x00000000; +} // namespace HourFormat + +namespace CalendarType { +static constexpr AttributeId Id = 0x00000001; +} // namespace CalendarType + +namespace SupportedCalendarTypes { +static constexpr AttributeId Id = 0x00000002; +} // namespace SupportedCalendarTypes + namespace AttributeList { static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; } // namespace AttributeList