From 8fc0354f0ce97b9eee0b39e12596bf48d774a57e Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 5 Mar 2025 10:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=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/GPIOControl.cpp | 4 ++++ app/src/main/cpp/GPIOControl.h | 15 +++++++++++++++ app/src/main/cpp/PhoneDevice.cpp | 5 ++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/GPIOControl.cpp b/app/src/main/cpp/GPIOControl.cpp index 3ca58538..f7453d56 100644 --- a/app/src/main/cpp/GPIOControl.cpp +++ b/app/src/main/cpp/GPIOControl.cpp @@ -210,6 +210,10 @@ size_t GpioControl::TurnOn(const std::vector& cmds) m_locker.lock(); for (it = cmds.cbegin(); it != cmds.cend(); ++it) { + if (*it == 0) + { + continue; + } param.cmd = *it; turnOnImpl(param); } diff --git a/app/src/main/cpp/GPIOControl.h b/app/src/main/cpp/GPIOControl.h index 2399ba29..54ceb729 100644 --- a/app/src/main/cpp/GPIOControl.h +++ b/app/src/main/cpp/GPIOControl.h @@ -507,6 +507,21 @@ public: GpioControl::TurnOff(m_cmds, m_delayCloseTime); } + std::string GetStatus() + { + std::string result; + for (auto it = m_cmds.cbegin(); it != m_cmds.cend(); ++it) + { + if (*it == 0) + { + continue; + } + result += std::to_string(*it) + "=" + std::to_string(GpioControl::getInt(*it)) + " "; + } + + return result; + } + protected: void TurnOn() { diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index cd6b2577..099dd117 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1556,7 +1556,10 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c if (netHandle == 0) { // timeout - XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet not existing CH=%u PR=%X PHOTOID=%u", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId); + std::string pwrStatus = powerCtrlPtr->GetStatus(); + pwrStatus += ethernetPowerCtrl->GetStatus(); + XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet Not Existing CH=%u PR=%X PHOTOID=%u PWR:%s", + (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId, pwrStatus.c_str()); TakePhotoCb(0, localPhotoInfo, "", 0); return false; }