diff --git a/src/lib/shell/commands/Device.cpp b/src/lib/shell/commands/Device.cpp index 7e26a75a5c..5f099ffa56 100644 --- a/src/lib/shell/commands/Device.cpp +++ b/src/lib/shell/commands/Device.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include #include #include #if CONFIG_DEVICE_LAYER @@ -42,7 +43,11 @@ int DeviceHelpHandler(int argc, char ** argv) static CHIP_ERROR FactoryResetHandler(int argc, char ** argv) { streamer_printf(streamer_get(), "Performing factory reset ... \r\n"); +#if CHIP_CONFIG_TEST DeviceLayer::ConfigurationMgr().InitiateFactoryReset(); +#else + chip::Server::GetInstance().ScheduleFactoryReset(); +#endif // CHIP_TEST return CHIP_NO_ERROR; }