From 8f49d82dec262bf126c458723b11d0163764fa2e Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 14 Apr 2025 14:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 300bc597..aba8172b 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1705,7 +1705,8 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c bool netCaptureResult = false; std::string lastError; - for (int idx = 0; idx < 128; idx++) + int idx = 0; + for (; idx < 128; idx++) { netHandle = GetEthnetHandle(); netPhotoInfo.netHandle = netHandle; @@ -1737,7 +1738,6 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c } if (netCaptureResult && !img.empty()) { - XYLOG(XYLOG_SEVERITY_INFO, "NetCapture Succeeded PHOTOID=%u Img Size=%u", localPhotoInfo.photoId, (uint32_t)img.size()); if(img.size() <= 1000) { lastError = ByteArrayToString(&img[0], img.size()); @@ -1746,6 +1746,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c rgb = cv::imdecode(cv::Mat(img), cv::IMREAD_COLOR); if (!rgb.empty()) { + XYLOG(XYLOG_SEVERITY_INFO, "NetCapture Succeeded PHOTOID=%u Img Size=%u Retries=%d", localPhotoInfo.photoId, (uint32_t)img.size(), idx); break; } } @@ -1783,8 +1784,8 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c } else { - XYLOG(XYLOG_SEVERITY_ERROR, "Failed to TP on NET Camera CH=%u PR=%X PHOTOID=%u URL=http://%s%s, LastErr:%s", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, - localPhotoInfo.photoId, netPhotoInfo.ip, netPhotoInfo.url, lastError.c_str()); + XYLOG(XYLOG_SEVERITY_ERROR, "Failed to TP on NET Camera CH=%u PR=%X PHOTOID=%u Retries=%d URL=http://%s%s, LastErr:%s", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, + localPhotoInfo.photoId, idx, netPhotoInfo.ip, netPhotoInfo.url, lastError.c_str()); #if !defined(NDEBUG) && defined(OUTPUT_DBG_INFO) std::string pwrStatus = powerCtrlPtr->GetStatus(); pwrStatus += ethernetPowerCtrl->GetStatus();