From db78ce77288e27d6103f7fdbcc955b571f93db47 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 23 Apr 2025 15:46:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96http=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index b3635549..ca73c134 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1728,22 +1728,7 @@ 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()) { if(img.size() <= 1000) @@ -1764,6 +1749,23 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c ethernetPowerCtrl.reset(); XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power OFF"); + 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 (!rgb.empty()) { time_t takingTime = ts;