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

[ESP32] fix the unsafe access to chip stack in lock-app #31171

Merged
merged 1 commit into from
Dec 22, 2023
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
6 changes: 3 additions & 3 deletions examples/lock-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CHIP_ERROR AppTask::Init()

sLockLED.Set(!BoltLockMgr().IsUnlocked());

chip::DeviceLayer::SystemLayer().ScheduleWork(UpdateClusterState, nullptr);
chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast<intptr_t>(nullptr));

ConfigurationMgr().LogDeviceConfig();

Expand Down Expand Up @@ -424,7 +424,7 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction)
}
if (sAppTask.mSyncClusterToButtonAction)
{
chip::DeviceLayer::SystemLayer().ScheduleWork(UpdateClusterState, nullptr);
chip::DeviceLayer::PlatformMgr().ScheduleWork(UpdateClusterState, reinterpret_cast<intptr_t>(nullptr));
sAppTask.mSyncClusterToButtonAction = false;
}
}
Expand Down Expand Up @@ -463,7 +463,7 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
}

/* if unlocked then it locked it first*/
void AppTask::UpdateClusterState(chip::System::Layer *, void * context)
void AppTask::UpdateClusterState(intptr_t context)
{
uint8_t newValue = !BoltLockMgr().IsUnlocked();

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AppTask
static void LockActionEventHandler(AppEvent * aEvent);
static void TimerEventHandler(TimerHandle_t xTimer);

static void UpdateClusterState(chip::System::Layer *, void * context);
static void UpdateClusterState(intptr_t context);

void StartTimer(uint32_t aTimeoutMs);

Expand Down
Loading