diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 90454a8f..942d797a 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1608,8 +1608,6 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c } else { - m_ethernetFailures = 0; - unsigned int ip = 0; unsigned int netMask = 0; unsigned int gateway = 0; @@ -1695,6 +1693,22 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c img.clear(); netCaptureResult = requestCapture(localPhotoInfo.channel, localPhotoInfo.preset, netPhotoInfo, img); + if (netCaptureResult) + { + m_ethernetFailures = 0; + } + else + { + m_ethernetFailures++; + if (m_ethernetFailures > 3) + { + time_t rebootTime = GetRebootTime(); + if (ts - rebootTime > 1800) + { + Reboot(REBOOT_TYPE_DEVICE, true, "Ethernet Not Existing"); + } + } + } if (netCaptureResult && !img.empty()) { XYLOG(XYLOG_SEVERITY_INFO, "NetCapture Succeeded PHOTOID=%u Img Size=%u", localPhotoInfo.photoId, (uint32_t)img.size());