Skip to content

Commit ec8f50e

Browse files
tersalrestyled-commitsandy31415andreilitvin
authored
Decouple TimeFormatLocalization cluster (project-chip#40148)
* Add initial TimeFormatLocalization decoupling * Add comments and changes to build test file * Add code improvements from internal feedback * Add FeatureFlags handling * Add changes to UnitTests * Add test persistence implementation * minor code fixes * revert local testing changes un python build * Move WriteAttribute to Logic layer * Start Read/Write UnitTest implementation using AttributePersistenceProvider * Update tests cases * Restyled by whitespace * Restyled by clang-format * reorganize code and add basic validations * Restyled by whitespace * Restyled by clang-format * Change initialization list in constructor * Restyled by whitespace * Restyled by clang-format * Reduce SampleProvider complexity and size for UnitTests * Add unit test for invalid values * Minor changes for constant elements * Add changes for AttributeListBuilder * Changes to AttributePersistenceProvider in Logic * Fix failures in unit test due change in Setters * Removed ember related callbacks * Change BitFlags initialization in Tests * Change include header format * Remove curly braces from switch statements when applicable * test integration of AttributePersistence * Combine change individual setter to a combined attribute handler in Logic * Removed test logs, and simplified code * Change zap generation for ClusterRevision * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-json * Remove breaking UnitTest * Change ember callbacks * Change calendar setter to avoid double decoding * Fix ActiveCalendarType not being stored properly * Remove test changes * Restyled by whitespace * Restyled by clang-format * Change type of AttributePersistenProvider in Logic layer * Regenerate ZAP code * Move logic to cluster * Remove unused files * Add fixes from PR comments * Remove additional logic for return error values * Change attributelist logic * Change default value handling for attributes * Revert ZAP changes for attributes * Adjust UnitTest for Cluster only layer implementation * Regenerate files with ZAP * Restyled by whitespace * Restyled by clang-format * Add review fixes * Revert changes to AttributePersistence * minor changes from review * Restyled by whitespace * Regenerate ZAP files * Add validation for empty Calendar list * Change error code for ReadAttribute * Update copyright dates for files that use partially the old implementation * Regenerate ZAP files * Slight updates for smaller code (30 bytes saved it seems) * Update for slightly smaller code, fix some logic and copyright. * Fix load/store logic a bit more. * Restyle * Update src/app/clusters/time-format-localization-server/time-format-localization-cluster.cpp * Fix logic to select a supported calendar. ZAP files seem to use defaults (i.e. 0 i.e. budhist calendar) which is wrong, but we must handle. * Restyle * Fix new callbacks for code driven clusters. * Undo the bad merge of shutdown functions. Sort the code driven cluster list. * Standardize the startup/shutdown for time format localization. This saves a bit of flash. * ZAP Regen and minor style update. * Update src/app/clusters/time-format-localization-server/time-format-localization-cluster.cpp --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
1 parent 2407615 commit ec8f50e

File tree

30 files changed

+720
-341
lines changed

30 files changed

+720
-341
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7716,14 +7716,14 @@ endpoint 0 {
77167716
}
77177717

77187718
server cluster TimeFormatLocalization {
7719-
persist attribute hourFormat default = 0;
7720-
persist attribute activeCalendarType default = 0;
7719+
ram attribute hourFormat default = 0;
7720+
ram attribute activeCalendarType default = 0;
77217721
callback attribute supportedCalendarTypes;
77227722
callback attribute generatedCommandList;
77237723
callback attribute acceptedCommandList;
77247724
callback attribute attributeList;
77257725
ram attribute featureMap default = 1;
7726-
ram attribute clusterRevision default = 1;
7726+
callback attribute clusterRevision;
77277727
}
77287728

77297729
server cluster UnitLocalization {

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@
14251425
"side": "server",
14261426
"type": "HourFormatEnum",
14271427
"included": 1,
1428-
"storageOption": "NVM",
1428+
"storageOption": "RAM",
14291429
"singleton": 0,
14301430
"bounded": 0,
14311431
"defaultValue": "0",
@@ -1441,7 +1441,7 @@
14411441
"side": "server",
14421442
"type": "CalendarTypeEnum",
14431443
"included": 1,
1444-
"storageOption": "NVM",
1444+
"storageOption": "RAM",
14451445
"singleton": 0,
14461446
"bounded": 0,
14471447
"defaultValue": "0",
@@ -1537,10 +1537,10 @@
15371537
"side": "server",
15381538
"type": "int16u",
15391539
"included": 1,
1540-
"storageOption": "RAM",
1540+
"storageOption": "External",
15411541
"singleton": 0,
15421542
"bounded": 0,
1543-
"defaultValue": "1",
1543+
"defaultValue": null,
15441544
"reportable": 1,
15451545
"minInterval": 1,
15461546
"maxInterval": 65534,

examples/all-clusters-app/realtek/data_model/all-clusters-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7895,7 +7895,7 @@ endpoint 0 {
78957895
callback attribute acceptedCommandList;
78967896
callback attribute attributeList;
78977897
ram attribute featureMap default = 1;
7898-
ram attribute clusterRevision default = 1;
7898+
callback attribute clusterRevision;
78997899
}
79007900

79017901
server cluster UnitLocalization {

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6525,7 +6525,7 @@ endpoint 0 {
65256525
callback attribute acceptedCommandList;
65266526
callback attribute attributeList;
65276527
ram attribute featureMap default = 0;
6528-
ram attribute clusterRevision default = 1;
6528+
callback attribute clusterRevision;
65296529
}
65306530

65316531
server cluster UnitLocalization {

examples/bridge-app/bridge-common/bridge-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ endpoint 0 {
23242324
callback attribute acceptedCommandList;
23252325
callback attribute attributeList;
23262326
ram attribute featureMap default = 0;
2327-
ram attribute clusterRevision default = 1;
2327+
callback attribute clusterRevision;
23282328
}
23292329

23302330
server cluster UnitLocalization {

examples/tv-app/tv-common/tv-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3712,7 +3712,7 @@ endpoint 0 {
37123712
persist attribute activeCalendarType default = 0;
37133713
callback attribute supportedCalendarTypes;
37143714
ram attribute featureMap default = 0;
3715-
ram attribute clusterRevision default = 1;
3715+
callback attribute clusterRevision;
37163716
}
37173717

37183718
server cluster UnitLocalization {

examples/tv-casting-app/tv-casting-common/tv-casting-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,7 @@ endpoint 0 {
30873087
persist attribute activeCalendarType default = 0;
30883088
callback attribute supportedCalendarTypes;
30893089
ram attribute featureMap default = 0;
3090-
ram attribute clusterRevision default = 1;
3090+
callback attribute clusterRevision;
30913091
}
30923092

30933093
server cluster UnitLocalization {

examples/virtual-device-app/virtual-device-common/virtual-device-app.matter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3673,7 +3673,7 @@ endpoint 0 {
36733673
persist attribute activeCalendarType default = 0;
36743674
callback attribute supportedCalendarTypes;
36753675
ram attribute featureMap default = 0;
3676-
ram attribute clusterRevision default = 1;
3676+
callback attribute clusterRevision;
36773677
}
36783678

36793679
server cluster UnitLocalization {

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CodeDrivenCallback.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ void MatterBasicInformationClusterInitCallback(chip::EndpointId endpointId);
3131

3232
void MatterBasicInformationClusterShutdownCallback(chip::EndpointId endpointId);
3333

34+
void MatterTimeFormatLocalizationClusterInitCallback(chip::EndpointId endpointId);
35+
36+
void MatterTimeFormatLocalizationClusterShutdownCallback(chip::EndpointId endpointId);
37+
3438
void MatterGeneralDiagnosticsClusterInitCallback(chip::EndpointId endpointId);
3539

3640
void MatterGeneralDiagnosticsClusterShutdownCallback(chip::EndpointId endpointId);

scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/CodeDrivenInitShutdown.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ void MatterClusterServerInitCallback(EndpointId endpoint, ClusterId clusterId)
3333
case app::Clusters::BasicInformation::Id:
3434
MatterBasicInformationClusterInitCallback(endpoint);
3535
break;
36+
case app::Clusters::TimeFormatLocalization::Id:
37+
MatterTimeFormatLocalizationClusterInitCallback(endpoint);
38+
break;
3639
case app::Clusters::GeneralDiagnostics::Id:
3740
MatterGeneralDiagnosticsClusterInitCallback(endpoint);
3841
break;
@@ -67,6 +70,9 @@ void MatterClusterServerShutdownCallback(EndpointId endpoint, ClusterId clusterI
6770
case app::Clusters::BasicInformation::Id:
6871
MatterBasicInformationClusterShutdownCallback(endpoint);
6972
break;
73+
case app::Clusters::TimeFormatLocalization::Id:
74+
MatterTimeFormatLocalizationClusterShutdownCallback(endpoint);
75+
break;
7076
case app::Clusters::GeneralDiagnostics::Id:
7177
MatterGeneralDiagnosticsClusterShutdownCallback(endpoint);
7278
break;

0 commit comments

Comments
 (0)