From f577a1be3deef3400b5fd61471e399f9c67c8a81 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 30 Mar 2025 10:58:11 +0800 Subject: [PATCH] =?UTF-8?q?HTTP=E8=AE=BF=E9=97=AE=E5=87=BA=E9=94=99?= =?UTF-8?q?=E4=B9=9F=E8=AE=A1=E5=85=A5=E7=BD=91=E7=BB=9C=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 超过3次重启设备 --- app/src/main/cpp/PhoneDevice.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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());