Skip to content

Commit

Permalink
Door lock: make example conformant (#30297)
Browse files Browse the repository at this point in the history
* Door lock: make example conformant

- on off cluster was non-conformant, but also, why was that there?
- time localization - same thing, not conformant, but also why
  did the door lock have this cluster to begin with?
- power source - added appropriate attributes for the selected
  features
- admin commissioning - can't have BCW command without the feature

* Attempt to fix esp32

* sneaky little thing was in there twice.
  • Loading branch information
cecille authored and pull[bot] committed Feb 7, 2024
1 parent 017f0cb commit e5eafc1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 435 deletions.
3 changes: 0 additions & 3 deletions examples/lock-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ idf_component_register(INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
Expand Down Expand Up @@ -173,7 +172,6 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
Expand All @@ -182,7 +180,6 @@ idf_component_register(PRIV_INCLUDE_DIRS
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server"
Expand Down
126 changes: 4 additions & 122 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -47,56 +47,6 @@ server cluster Identify = 3 {
command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
}

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
server cluster OnOff = 6 {
enum DelayedAllOffEffectVariantEnum : enum8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
kDelayedOffSlowFade = 2;
}

enum DyingLightEffectVariantEnum : enum8 {
kDyingLightFadeOff = 0;
}

enum EffectIdentifierEnum : enum8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum StartUpOnOffEnum : enum8 {
kOff = 0;
kOn = 1;
kToggle = 2;
}

bitmap Feature : bitmap32 {
kLighting = 0x1;
kDeadFrontBehavior = 0x2;
kOffOnly = 0x4;
}

bitmap OnOffControlBitmap : bitmap8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute access(write: manage) nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

command Off(): DefaultSuccess = 0;
command On(): DefaultSuccess = 1;
command Toggle(): DefaultSuccess = 2;
}

/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
server cluster Descriptor = 29 {
bitmap Feature : bitmap32 {
Expand Down Expand Up @@ -453,46 +403,6 @@ server cluster LocalizationConfiguration = 43 {
readonly attribute int16u clusterRevision = 65533;
}

/** 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. */
server cluster TimeFormatLocalization = 44 {
enum CalendarTypeEnum : enum8 {
kBuddhist = 0;
kChinese = 1;
kCoptic = 2;
kEthiopian = 3;
kGregorian = 4;
kHebrew = 5;
kIndian = 6;
kIslamic = 7;
kJapanese = 8;
kKorean = 9;
kPersian = 10;
kTaiwanese = 11;
}

enum HourFormatEnum : enum8 {
k12hr = 0;
k24hr = 1;
}

bitmap Feature : bitmap32 {
kCalendarFormat = 0x1;
}

attribute access(write: manage) HourFormatEnum hourFormat = 0;
attribute access(write: manage) CalendarTypeEnum activeCalendarType = 1;
readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;
}

/** Nodes should be expected to be deployed to any and all regions of the world. These global regions
may have differing preferences for the units in which values are conveyed in communication to a
user. As such, Nodes that visually or audibly convey measurable values to the user need a
Expand Down Expand Up @@ -736,11 +646,13 @@ server cluster PowerSource = 47 {
readonly attribute PowerSourceStatusEnum status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
readonly attribute WiredCurrentTypeEnum wiredCurrentType = 5;
readonly attribute nullable int32u wiredAssessedCurrent = 6;
readonly attribute BatChargeLevelEnum batChargeLevel = 14;
readonly attribute boolean batReplacementNeeded = 15;
readonly attribute BatReplaceabilityEnum batReplaceability = 16;
readonly attribute char_string<60> batReplacementDescription = 19;
readonly attribute int8u batQuantity = 25;
readonly attribute endpoint_no endpointList[] = 31;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -1465,12 +1377,7 @@ server cluster AdministratorCommissioning = 60 {
octet_string<32> salt = 4;
}

request struct OpenBasicCommissioningWindowRequest {
int16u commissioningTimeout = 0;
}

timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2;
}

Expand Down Expand Up @@ -2422,18 +2329,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;
}

server cluster TimeFormatLocalization {
persist attribute hourFormat default = 0;
persist attribute activeCalendarType default = 0;
callback attribute supportedCalendarTypes;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster UnitLocalization {
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
Expand All @@ -2448,6 +2343,7 @@ endpoint 0 {
ram attribute status default = 1;
ram attribute order default = 0;
ram attribute description default = "USB";
ram attribute wiredCurrentType default = 0;
ram attribute wiredAssessedCurrent;
callback attribute endpointList;
callback attribute generatedCommandList;
Expand Down Expand Up @@ -2671,7 +2567,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;

handle command OpenCommissioningWindow;
handle command OpenBasicCommissioningWindow;
handle command RevokeCommissioning;
}

Expand Down Expand Up @@ -2762,20 +2657,6 @@ endpoint 1 {
handle command TriggerEffect;
}

server cluster OnOff {
ram attribute onOff default = 0x00;
ram attribute globalSceneControl default = 1;
ram attribute onTime default = 0;
ram attribute offWaitTime default = 0;
ram attribute startUpOnOff;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 5;

handle command Off;
handle command On;
handle command Toggle;
}

server cluster Descriptor {
callback attribute deviceTypeList;
callback attribute serverList;
Expand All @@ -2797,6 +2678,7 @@ endpoint 1 {
ram attribute batReplacementNeeded;
ram attribute batReplaceability;
ram attribute batReplacementDescription;
ram attribute batQuantity default = 1;
callback attribute endpointList;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
Expand Down
Loading

0 comments on commit e5eafc1

Please sign in to comment.