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

[nxp] Fix/lit icd: enable MaximumCheckInBackoff and simplify ButtonManager code #35695

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -2008,6 +2008,7 @@ endpoint 0 {
ram attribute userActiveModeTriggerHint default = 4096;
ram attribute userActiveModeTriggerInstruction default = "Push setup button for Active Mode";
ram attribute operatingMode default = 0;
callback attribute maximumCheckInBackOff;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
Expand Down
16 changes: 16 additions & 0 deletions examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -3726,6 +3726,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "MaximumCheckInBackOff",
"code": 9,
"mfgCode": null,
"side": "server",
"type": "int32u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
Expand Down
11 changes: 3 additions & 8 deletions examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ ButtonManager ButtonManager::sInstance;

TimerHandle_t resetTimer;

#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
static bool sitModeRequested;
#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS

CHIP_ERROR ButtonManager::Init()
{
resetTimer = xTimerCreate("FnTmr", 1, false, (void *) this, [](TimerHandle_t xTimer) {
Expand All @@ -65,10 +61,6 @@ CHIP_ERROR ButtonManager::Init()
});
VerifyOrReturnError(resetTimer != NULL, APP_ERROR_CREATE_TIMER_FAILED);

#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
static bool sitModeRequested;
#endif // CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS

return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -208,6 +200,9 @@ void ButtonManager::BleHandler(const AppEvent & event)
#if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS)
void ButtonManager::DSLSActionEventHandler(const AppEvent & event)
{

static bool sitModeRequested = false;

if (chip::DeviceLayer::ConfigurationMgr().IsFullyProvisioned())
{
if (!sitModeRequested)
Expand Down
3 changes: 3 additions & 0 deletions examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "fsl_component_button.h"

#include <app/icd/server/ICDServerConfig.h>
#include <lib/core/CHIPError.h>

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

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

/**
* @brief This callback performs a factory reset.
Expand Down
Loading