Skip to content

Commit

Permalink
[nrf noup] Remove dependncy to Server
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Gielniewski <[email protected]>
  • Loading branch information
adigie committed Feb 10, 2025
1 parent 42af0b0 commit 161d2d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,4 +796,9 @@ Crypto::DefaultSessionKeystore CommonCaseDeviceServerInitParams::sSessionKeystor
app::DefaultICDCheckInBackOffStrategy CommonCaseDeviceServerInitParams::sDefaultICDCheckInBackOffStrategy;
#endif

void ServerScheduleFactoryReset()
{
chip::Server::GetInstance().ScheduleFactoryReset();
}

} // namespace chip
2 changes: 2 additions & 0 deletions src/app/server/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,4 +704,6 @@ class Server
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
};

void ServerScheduleFactoryReset();

} // namespace chip
6 changes: 4 additions & 2 deletions src/lib/shell/commands/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
* limitations under the License.
*/

#include <app/server/Server.h>
#include <lib/shell/Commands.h>
#include <lib/shell/Engine.h>
#include <lib/shell/SubShellCommand.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>

namespace chip {

void ServerScheduleFactoryReset();

namespace Shell {

static CHIP_ERROR FactoryResetHandler(int argc, char ** argv)
Expand All @@ -31,7 +33,7 @@ static CHIP_ERROR FactoryResetHandler(int argc, char ** argv)
#if CHIP_CONFIG_TEST
DeviceLayer::ConfigurationMgr().InitiateFactoryReset();
#else
chip::Server::GetInstance().ScheduleFactoryReset();
ServerScheduleFactoryReset();
#endif // CHIP_TEST
return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 161d2d6

Please sign in to comment.