优化日志

heatbeat
Matthew 3 months ago
parent 295aadfc16
commit a9145e8871

@ -1158,16 +1158,11 @@ bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reaso
return false; return false;
} }
} }
std::thread t([manually, timeout]()
{
XYLOG(XYLOG_SEVERITY_WARNING, "Recv REBOOT command Manually=%d", manually ? 1 : 0);
std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
if (manually) if (manually)
{ {
GpioControl::reboot(); // GpioControl::reboot();
RestartApp(resetType, timeout, reason);
} }
});
t.detach();
} }
else else
{ {
@ -1348,15 +1343,12 @@ void CPhoneDevice::handleRebootTimer(union sigval v)
} }
#endif #endif
CPhoneDevice* pDevice = (CPhoneDevice*)(v.sival_ptr); CPhoneDevice* pDevice = (CPhoneDevice*)(v.sival_ptr);
const IDevice::PHOTO_INFO& photoInfo = pDevice->mPhotoInfo;
// Reboot APP // Reboot APP
XYLOG(XYLOG_SEVERITY_ERROR, "Camera Close Thread is DEAD, will RESTART app"); XYLOG(XYLOG_SEVERITY_ERROR, "Camera Close Thread is DEAD, will RESTART app CH=%u PR=%X", photoInfo->channel, photoInfo->preset);
pDevice->RestartApp(REBOOT_TYPE_APP, 30000, "Camera Can't Close"); pDevice->RestartApp(REBOOT_TYPE_APP, 30000, "Camera Cant Close");
} }
// void CPhoneDevice::handleRebootTimerImpl()
// {
// }
IDevice::timer_uid_t CPhoneDevice::RegisterTimer(unsigned int timerType, unsigned int timeout, void* data, uint64_t times/* = 0*/) IDevice::timer_uid_t CPhoneDevice::RegisterTimer(unsigned int timerType, unsigned int timeout, void* data, uint64_t times/* = 0*/)
{ {
struct sigevent evp = { 0 }; struct sigevent evp = { 0 };

Loading…
Cancel
Save