Skip to content

Commit 0891058

Browse files
doublemis1ArekBalysNordic
authored andcommitted
samples: matter: fix data model to be compliance
Fix data model for contact and temperature sensor Signed-off-by: Michał Szablowski <[email protected]>
1 parent 1e70fae commit 0891058

16 files changed

+887
-1388
lines changed

samples/matter/contact_sensor/src/default_zap/contact_sensor.matter

Lines changed: 18 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -802,257 +802,15 @@ cluster OtaSoftwareUpdateRequestor = 42 {
802802
command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0;
803803
}
804804

805-
/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */
806-
cluster PowerSource = 47 {
807-
revision 1; // NOTE: Default/not specifically set
808-
809-
enum BatApprovedChemistryEnum : enum16 {
810-
kUnspecified = 0;
811-
kAlkaline = 1;
812-
kLithiumCarbonFluoride = 2;
813-
kLithiumChromiumOxide = 3;
814-
kLithiumCopperOxide = 4;
815-
kLithiumIronDisulfide = 5;
816-
kLithiumManganeseDioxide = 6;
817-
kLithiumThionylChloride = 7;
818-
kMagnesium = 8;
819-
kMercuryOxide = 9;
820-
kNickelOxyhydride = 10;
821-
kSilverOxide = 11;
822-
kZincAir = 12;
823-
kZincCarbon = 13;
824-
kZincChloride = 14;
825-
kZincManganeseDioxide = 15;
826-
kLeadAcid = 16;
827-
kLithiumCobaltOxide = 17;
828-
kLithiumIon = 18;
829-
kLithiumIonPolymer = 19;
830-
kLithiumIronPhosphate = 20;
831-
kLithiumSulfur = 21;
832-
kLithiumTitanate = 22;
833-
kNickelCadmium = 23;
834-
kNickelHydrogen = 24;
835-
kNickelIron = 25;
836-
kNickelMetalHydride = 26;
837-
kNickelZinc = 27;
838-
kSilverZinc = 28;
839-
kSodiumIon = 29;
840-
kSodiumSulfur = 30;
841-
kZincBromide = 31;
842-
kZincCerium = 32;
843-
}
844-
845-
enum BatChargeFaultEnum : enum8 {
846-
kUnspecified = 0;
847-
kAmbientTooHot = 1;
848-
kAmbientTooCold = 2;
849-
kBatteryTooHot = 3;
850-
kBatteryTooCold = 4;
851-
kBatteryAbsent = 5;
852-
kBatteryOverVoltage = 6;
853-
kBatteryUnderVoltage = 7;
854-
kChargerOverVoltage = 8;
855-
kChargerUnderVoltage = 9;
856-
kSafetyTimeout = 10;
857-
}
858-
859-
enum BatChargeLevelEnum : enum8 {
860-
kOK = 0 [spec_name = "OK"];
861-
kWarning = 1;
862-
kCritical = 2;
863-
}
864-
865-
enum BatChargeStateEnum : enum8 {
866-
kUnknown = 0;
867-
kIsCharging = 1;
868-
kIsAtFullCharge = 2;
869-
kIsNotCharging = 3;
870-
}
871-
872-
enum BatCommonDesignationEnum : enum16 {
873-
kUnspecified = 0;
874-
kAAA = 1 [spec_name = "AAA"];
875-
kAA = 2 [spec_name = "AA"];
876-
kC = 3;
877-
kD = 4;
878-
k4v5 = 5;
879-
k6v0 = 6;
880-
k9v0 = 7;
881-
k12AA = 8 [spec_name = "1_2AA"];
882-
kAAAA = 9 [spec_name = "AAAA"];
883-
kA = 10;
884-
kB = 11;
885-
kF = 12;
886-
kN = 13;
887-
kNo6 = 14;
888-
kSubC = 15;
889-
kA23 = 16;
890-
kA27 = 17;
891-
kBA5800 = 18 [spec_name = "BA5800"];
892-
kDuplex = 19;
893-
k4SR44 = 20 [spec_name = "4SR44"];
894-
k523 = 21;
895-
k531 = 22;
896-
k15v0 = 23;
897-
k22v5 = 24;
898-
k30v0 = 25;
899-
k45v0 = 26;
900-
k67v5 = 27;
901-
kJ = 28;
902-
kCR123A = 29 [spec_name = "CR123A"];
903-
kCR2 = 30 [spec_name = "CR2"];
904-
k2CR5 = 31 [spec_name = "2CR5"];
905-
kCRP2 = 32 [spec_name = "CR_P2"];
906-
kCRV3 = 33 [spec_name = "CR_V3"];
907-
kSR41 = 34 [spec_name = "SR41"];
908-
kSR43 = 35 [spec_name = "SR43"];
909-
kSR44 = 36 [spec_name = "SR44"];
910-
kSR45 = 37 [spec_name = "SR45"];
911-
kSR48 = 38 [spec_name = "SR48"];
912-
kSR54 = 39 [spec_name = "SR54"];
913-
kSR55 = 40 [spec_name = "SR55"];
914-
kSR57 = 41 [spec_name = "SR57"];
915-
kSR58 = 42 [spec_name = "SR58"];
916-
kSR59 = 43 [spec_name = "SR59"];
917-
kSR60 = 44 [spec_name = "SR60"];
918-
kSR63 = 45 [spec_name = "SR63"];
919-
kSR64 = 46 [spec_name = "SR64"];
920-
kSR65 = 47 [spec_name = "SR65"];
921-
kSR66 = 48 [spec_name = "SR66"];
922-
kSR67 = 49 [spec_name = "SR67"];
923-
kSR68 = 50 [spec_name = "SR68"];
924-
kSR69 = 51 [spec_name = "SR69"];
925-
kSR516 = 52 [spec_name = "SR516"];
926-
kSR731 = 53 [spec_name = "SR731"];
927-
kSR712 = 54 [spec_name = "SR712"];
928-
kLR932 = 55 [spec_name = "LR932"];
929-
kA5 = 56;
930-
kA10 = 57;
931-
kA13 = 58;
932-
kA312 = 59;
933-
kA675 = 60;
934-
kAC41E = 61 [spec_name = "AC41E"];
935-
k10180 = 62;
936-
k10280 = 63;
937-
k10440 = 64;
938-
k14250 = 65;
939-
k14430 = 66;
940-
k14500 = 67;
941-
k14650 = 68;
942-
k15270 = 69;
943-
k16340 = 70;
944-
kRCR123A = 71 [spec_name = "RCR123A"];
945-
k17500 = 72;
946-
k17670 = 73;
947-
k18350 = 74;
948-
k18500 = 75;
949-
k18650 = 76;
950-
k19670 = 77;
951-
k25500 = 78;
952-
k26650 = 79;
953-
k32600 = 80;
954-
}
955-
956-
enum BatFaultEnum : enum8 {
957-
kUnspecified = 0;
958-
kOverTemp = 1;
959-
kUnderTemp = 2;
960-
}
961-
962-
enum BatReplaceabilityEnum : enum8 {
963-
kUnspecified = 0;
964-
kNotReplaceable = 1;
965-
kUserReplaceable = 2;
966-
kFactoryReplaceable = 3;
967-
}
968-
969-
enum PowerSourceStatusEnum : enum8 {
970-
kUnspecified = 0;
971-
kActive = 1;
972-
kStandby = 2;
973-
kUnavailable = 3;
974-
}
975-
976-
enum WiredCurrentTypeEnum : enum8 {
977-
kAC = 0 [spec_name = "AC"];
978-
kDC = 1 [spec_name = "DC"];
979-
}
980-
981-
enum WiredFaultEnum : enum8 {
982-
kUnspecified = 0;
983-
kOverVoltage = 1;
984-
kUnderVoltage = 2;
985-
}
805+
/** Nodes should be expected to be deployed to any and all regions of the world. These global regions
806+
may have differing common languages, units of measurements, and numerical formatting
807+
standards. As such, Nodes that visually or audibly convey information need a mechanism by which
808+
they can be configured to use a user’s preferred language, units, etc */
809+
cluster LocalizationConfiguration = 43 {
810+
revision 1;
986811

987-
bitmap Feature : bitmap32 {
988-
kWired = 0x1;
989-
kBattery = 0x2;
990-
kRechargeable = 0x4;
991-
kReplaceable = 0x8;
992-
}
993-
994-
struct BatChargeFaultChangeType {
995-
BatChargeFaultEnum current[] = 0;
996-
BatChargeFaultEnum previous[] = 1;
997-
}
998-
999-
struct BatFaultChangeType {
1000-
BatFaultEnum current[] = 0;
1001-
BatFaultEnum previous[] = 1;
1002-
}
1003-
1004-
struct WiredFaultChangeType {
1005-
WiredFaultEnum current[] = 0;
1006-
WiredFaultEnum previous[] = 1;
1007-
}
1008-
1009-
info event WiredFaultChange = 0 {
1010-
WiredFaultEnum current[] = 0;
1011-
WiredFaultEnum previous[] = 1;
1012-
}
1013-
1014-
info event BatFaultChange = 1 {
1015-
BatFaultEnum current[] = 0;
1016-
BatFaultEnum previous[] = 1;
1017-
}
1018-
1019-
info event BatChargeFaultChange = 2 {
1020-
BatChargeFaultEnum current[] = 0;
1021-
BatChargeFaultEnum previous[] = 1;
1022-
}
1023-
1024-
readonly attribute PowerSourceStatusEnum status = 0;
1025-
readonly attribute int8u order = 1;
1026-
readonly attribute char_string<60> description = 2;
1027-
readonly attribute optional nullable int32u wiredAssessedInputVoltage = 3;
1028-
readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4;
1029-
readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5;
1030-
readonly attribute optional nullable int32u wiredAssessedCurrent = 6;
1031-
readonly attribute optional int32u wiredNominalVoltage = 7;
1032-
readonly attribute optional int32u wiredMaximumCurrent = 8;
1033-
readonly attribute optional boolean wiredPresent = 9;
1034-
readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10;
1035-
readonly attribute optional nullable int32u batVoltage = 11;
1036-
readonly attribute optional nullable int8u batPercentRemaining = 12;
1037-
readonly attribute optional nullable int32u batTimeRemaining = 13;
1038-
readonly attribute optional BatChargeLevelEnum batChargeLevel = 14;
1039-
readonly attribute optional boolean batReplacementNeeded = 15;
1040-
readonly attribute optional BatReplaceabilityEnum batReplaceability = 16;
1041-
readonly attribute optional boolean batPresent = 17;
1042-
readonly attribute optional BatFaultEnum activeBatFaults[] = 18;
1043-
readonly attribute optional char_string<60> batReplacementDescription = 19;
1044-
readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20;
1045-
readonly attribute optional char_string<20> batANSIDesignation = 21;
1046-
readonly attribute optional char_string<20> batIECDesignation = 22;
1047-
readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23;
1048-
readonly attribute optional int32u batCapacity = 24;
1049-
readonly attribute optional int8u batQuantity = 25;
1050-
readonly attribute optional BatChargeStateEnum batChargeState = 26;
1051-
readonly attribute optional nullable int32u batTimeToFullCharge = 27;
1052-
readonly attribute optional boolean batFunctionalWhileCharging = 28;
1053-
readonly attribute optional nullable int32u batChargingCurrent = 29;
1054-
readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30;
1055-
readonly attribute endpoint_no endpointList[] = 31;
812+
attribute access(write: manage) char_string<35> activeLocale = 0;
813+
readonly attribute char_string supportedLocales[] = 1;
1056814
readonly attribute command_id generatedCommandList[] = 65528;
1057815
readonly attribute command_id acceptedCommandList[] = 65529;
1058816
readonly attribute attrib_id attributeList[] = 65531;
@@ -2107,7 +1865,6 @@ cluster IcdManagement = 70 {
21071865

21081866
endpoint 0 {
21091867
device type ma_rootdevice = 22, version 3;
2110-
device type ma_powersource = 17, version 1;
21111868
device type ma_otarequestor = 18, version 1;
21121869

21131870
binding cluster OtaSoftwareUpdateProvider;
@@ -2158,6 +1915,7 @@ endpoint 0 {
21581915
callback attribute capabilityMinima;
21591916
callback attribute specificationVersion;
21601917
callback attribute maxPathsPerInvoke;
1918+
ram attribute configurationVersion default = 1;
21611919
callback attribute generatedCommandList;
21621920
callback attribute acceptedCommandList;
21631921
callback attribute attributeList;
@@ -2182,17 +1940,14 @@ endpoint 0 {
21821940
handle command AnnounceOTAProvider;
21831941
}
21841942

2185-
server cluster PowerSource {
2186-
ram attribute status default = 1;
2187-
ram attribute order default = 1;
2188-
ram attribute description;
2189-
ram attribute wiredCurrentType default = 1;
2190-
callback attribute endpointList;
1943+
server cluster LocalizationConfiguration {
1944+
ram attribute activeLocale;
1945+
callback attribute supportedLocales;
21911946
callback attribute generatedCommandList;
21921947
callback attribute acceptedCommandList;
21931948
callback attribute attributeList;
2194-
ram attribute featureMap default = 1;
2195-
ram attribute clusterRevision default = 3;
1949+
ram attribute featureMap default = 0;
1950+
ram attribute clusterRevision default = 1;
21961951
}
21971952

21981953
server cluster GeneralCommissioning {
@@ -2395,6 +2150,9 @@ endpoint 0 {
23952150
handle command UpdateFabricLabel;
23962151
handle command RemoveFabric;
23972152
handle command AddTrustedRootCertificate;
2153+
handle command SetVIDVerificationStatement;
2154+
handle command SignVIDVerificationRequest;
2155+
handle command SignVIDVerificationResponse;
23982156
}
23992157

24002158
server cluster GroupKeyManagement {
@@ -2451,7 +2209,7 @@ endpoint 1 {
24512209
callback attribute acceptedCommandList;
24522210
callback attribute attributeList;
24532211
ram attribute featureMap default = 0;
2454-
ram attribute clusterRevision default = 5;
2212+
ram attribute clusterRevision default = 6;
24552213

24562214
handle command Identify;
24572215
handle command TriggerEffect;

0 commit comments

Comments
 (0)