Skip to content

Commit a831d0a

Browse files
authored
[nxp] Fix/lit icd: enable MaximumCheckInBackoff and simplify ButtonManager code (#35695)
* [mcxw71_k32w1] lit icd: enable MaximumCheckInBackoff attribute Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com> * [mcxw71_k32w1] lit icd: simplify code around ButtonManager Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com> --------- Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
1 parent 3dd0a0f commit a831d0a

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,7 @@ endpoint 0 {
20082008
ram attribute userActiveModeTriggerHint default = 4096;
20092009
ram attribute userActiveModeTriggerInstruction default = "Push setup button for Active Mode";
20102010
ram attribute operatingMode default = 0;
2011+
callback attribute maximumCheckInBackOff;
20112012
callback attribute generatedCommandList;
20122013
callback attribute acceptedCommandList;
20132014
callback attribute eventList;

examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap

+16
Original file line numberDiff line numberDiff line change
@@ -3726,6 +3726,22 @@
37263726
"maxInterval": 65534,
37273727
"reportableChange": 0
37283728
},
3729+
{
3730+
"name": "MaximumCheckInBackOff",
3731+
"code": 9,
3732+
"mfgCode": null,
3733+
"side": "server",
3734+
"type": "int32u",
3735+
"included": 1,
3736+
"storageOption": "External",
3737+
"singleton": 0,
3738+
"bounded": 0,
3739+
"defaultValue": "",
3740+
"reportable": 1,
3741+
"minInterval": 1,
3742+
"maxInterval": 65534,
3743+
"reportableChange": 0
3744+
},
37293745
{
37303746
"name": "GeneratedCommandList",
37313747
"code": 65528,

examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ ButtonManager ButtonManager::sInstance;
5252

5353
TimerHandle_t resetTimer;
5454

55-
#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
56-
static bool sitModeRequested;
57-
#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS
58-
5955
CHIP_ERROR ButtonManager::Init()
6056
{
6157
resetTimer = xTimerCreate("FnTmr", 1, false, (void *) this, [](TimerHandle_t xTimer) {
@@ -65,10 +61,6 @@ CHIP_ERROR ButtonManager::Init()
6561
});
6662
VerifyOrReturnError(resetTimer != NULL, APP_ERROR_CREATE_TIMER_FAILED);
6763

68-
#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
69-
static bool sitModeRequested;
70-
#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS
71-
7264
return CHIP_NO_ERROR;
7365
}
7466

@@ -208,6 +200,9 @@ void ButtonManager::BleHandler(const AppEvent & event)
208200
#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
209201
void ButtonManager::DSLSActionEventHandler(const AppEvent & event)
210202
{
203+
204+
static bool sitModeRequested = false;
205+
211206
if (chip::DeviceLayer::ConfigurationMgr().IsFullyProvisioned())
212207
{
213208
if (!sitModeRequested)

examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "fsl_component_button.h"
2727

28+
#include <app/icd/server/ICDServerConfig.h>
2829
#include <lib/core/CHIPError.h>
2930

3031
// Application-defined error codes in the CHIP_ERROR space.
@@ -87,12 +88,14 @@ class ButtonManager
8788
*/
8889
static void ResetActionEventHandler(const AppEvent & event);
8990

91+
#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
9092
/**
9193
* @brief This callback schedules a DSLS LIT action (Dynamic SIT LIT Support).
9294
*
9395
* It is used when the app requests SIT mode (check spec, "Runtime Operating Mode Switching")
9496
*/
9597
static void DSLSActionEventHandler(const AppEvent & event);
98+
#endif /* CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS */
9699

97100
/**
98101
* @brief This callback performs a factory reset.

0 commit comments

Comments
 (0)