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

We should call correct API for factory reset in CLI command #31505

Closed
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
3 changes: 2 additions & 1 deletion src/lib/shell/commands/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#if CONFIG_DEVICE_LAYER
#include <platform/CHIPDeviceLayer.h>
#endif
#include <app/server/Server.h>
#include <lib/shell/Engine.h>
#include <lib/shell/commands/Help.h>
#include <lib/support/CHIPArgParser.hpp>
Expand All @@ -42,7 +43,7 @@ int DeviceHelpHandler(int argc, char ** argv)
static CHIP_ERROR FactoryResetHandler(int argc, char ** argv)
{
streamer_printf(streamer_get(), "Performing factory reset ... \r\n");
DeviceLayer::ConfigurationMgr().InitiateFactoryReset();
chip::Server::GetInstance().ScheduleFactoryReset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done this way to avoid dependency between src/lib and app as app was supposed to be the top-level component. I guess the best way to workaround it would be moving the shell commands to the app directory but not sure how much work that would be...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. Closing the PR

return CHIP_NO_ERROR;
}

Expand Down
Loading