重启设备前记录日志

NWMQTT
Matthew 2 months ago
parent 030ca9c7d7
commit 3a0a8b71a0

@ -1169,6 +1169,9 @@ bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reaso
{ {
if (resetType == REBOOT_TYPE_DEVICE) if (resetType == REBOOT_TYPE_DEVICE)
{ {
std::string fileName = (manually ? "0_" : "1_") + std::to_string(GetMicroTimeStamp());
fileName = m_appPath + (APP_PATH_TMP DIR_SEP_STR "reboot_") + fileName + std::string(".txt");
writeFile(fileName, (const unsigned char*)reason.c_str(), reason.size());
// reboot the device // reboot the device
if (!manually) if (!manually)
{ {
@ -1183,6 +1186,7 @@ bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reaso
if (manually) if (manually)
{ {
#ifdef USING_N938 #ifdef USING_N938
GpioControl::reboot(); GpioControl::reboot();
#else #else
RestartApp(resetType, timeout, reason); RestartApp(resetType, timeout, reason);

Loading…
Cancel
Save