Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MaxCumulativeFailsafeSeconds #19582

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
2 changes: 2 additions & 0 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ client cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down Expand Up @@ -654,6 +655,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
2 changes: 2 additions & 0 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ client cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down Expand Up @@ -654,6 +655,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
2 changes: 2 additions & 0 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ client cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down Expand Up @@ -633,6 +634,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
1 change: 1 addition & 0 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ server cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ CHIP_ERROR GeneralCommissioningAttrAccess::ReadBasicCommissioningInfo(AttributeV

// TODO: The commissioner might use the critical parameters in BasicCommissioningInfo to initialize
// the CommissioningParameters at the beginning of commissioning flow.
basicCommissioningInfo.failSafeExpiryLengthSeconds = CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC;
basicCommissioningInfo.failSafeExpiryLengthSeconds = CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC;
basicCommissioningInfo.maxCumulativeFailsafeSeconds = CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC;
static_assert(CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC >= CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC,
"Max cumulative failsafe seconds must be larger than failsafe expiry length seconds");

return aEncoder.Encode(basicCommissioningInfo);
}
Expand All @@ -140,7 +143,7 @@ CHIP_ERROR GeneralCommissioningAttrAccess::ReadSupportsConcurrentConnection(Attr

// TODO: The commissioner might use the critical parameters in BasicCommissioningInfo to initialize
// the CommissioningParameters at the beginning of commissioning flow.
supportsConcurrentConnection = (CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC) != 0;
supportsConcurrentConnection = (CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION) != 0;

return aEncoder.Encode(supportsConcurrentConnection);
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ tests:
command: "readAttribute"
attribute: "BasicCommissioningInfo"
response:
value: { FailSafeExpiryLengthSeconds: 60 }
value:
{
FailSafeExpiryLengthSeconds: 60,
MaxCumulativeFailsafeSeconds: 900,
tehampson marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ limitations under the License.
<struct name="BasicCommissioningInfo">
<cluster code="0x0030"/>
<item name="FailSafeExpiryLengthSeconds" type="INT16U"/>
<item name="MaxCumulativeFailsafeSeconds" type="INT16U"/>
tehampson marked this conversation as resolved.
Show resolved Hide resolved
</struct>
<cluster>
<domain>General</domain>
Expand Down
1 change: 1 addition & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,7 @@ client cluster GeneralCommissioning = 48 {

struct BasicCommissioningInfo {
int16u failSafeExpiryLengthSeconds = 0;
int16u maxCumulativeFailsafeSeconds = 1;
}

attribute access(write: administer) int64u breadcrumb = 0;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/include/platform/CHIPDeviceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@
#define CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC 60
#endif // CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC

/**
* CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC
*
* The default conservative value in seconds denoting the maximum total duration for which a fail safe
* timer can be re-armed.
*/
#ifndef CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC
#define CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC 900
#endif // CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC

/**
* CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
*
Expand Down
6 changes: 6 additions & 0 deletions src/include/platform/FailSafeContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ class FailSafeContext
*/
static void HandleArmFailSafeTimer(System::Layer * layer, void * aAppState);

/**
* @brief
* The callback function to be called when max cumulative time expires.
*/
static void HandleMaxCumulativeFailSafeTimer(System::Layer * layer, void * aAppState);

/**
* @brief
* The callback function to be called asynchronously after various cleanup work has completed
Expand Down
Loading