From a2aef51df6176330e7537ea6829c6d46994bf621 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 28 Mar 2025 10:28:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=91getInt=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/GPIOControl.cpp | 10 ++++++---- app/src/main/cpp/GPIOControl.h | 6 ++++-- app/src/main/cpp/PhoneDevice.cpp | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/src/main/cpp/GPIOControl.cpp b/app/src/main/cpp/GPIOControl.cpp index 0948611c..db04585e 100644 --- a/app/src/main/cpp/GPIOControl.cpp +++ b/app/src/main/cpp/GPIOControl.cpp @@ -66,8 +66,9 @@ size_t GpioControl::turnOnImpl(const IOT_PARAM& param) res = ioctl(fd, IOT_PARAM_WRITE, ¶m); close(fd); #ifdef OUTPUT_DBG_INFO - int realVal = getInt(param.cmd); - XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d RealVal=%d",param.cmd, param.value, param.result, realVal); + // int realVal = getInt(param.cmd); + // XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d RealVal=%d",param.cmd, param.value, param.result/*, realVal*/); + XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d",param.cmd, param.value, param.result); #endif } #ifdef _DEBUG @@ -91,8 +92,9 @@ void GpioControl::setInt(int cmd, int value) int res = ioctl(fd, IOT_PARAM_WRITE, ¶m); close(fd); #ifdef OUTPUT_DBG_INFO - int realVal = getInt(param.cmd); - XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d RealVal=%d",param.cmd, value, param.result, realVal); + // int realVal = getInt(param.cmd); + // XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d RealVal=%d",param.cmd, value, param.result/*, realVal*/); + XYLOG(XYLOG_SEVERITY_INFO, "setInt cmd=%d,value=%d,result=%d",param.cmd, value, param.result); #endif } } diff --git a/app/src/main/cpp/GPIOControl.h b/app/src/main/cpp/GPIOControl.h index 615dfe2c..913ff520 100644 --- a/app/src/main/cpp/GPIOControl.h +++ b/app/src/main/cpp/GPIOControl.h @@ -529,12 +529,13 @@ public: virtual ~PowerControl() { GpioControl::TurnOff(m_cmds, m_delayCloseTime); -#ifdef OUTPUT_DBG_INFO +#if !defined(NDEBUG) && defined(OUTPUT_DBG_INFO) std::string status = GetStatus(); XYLOG(XYLOG_SEVERITY_INFO, "PWR After TurnOff %s, DelayCloseTime=%u", status.c_str(), m_delayCloseTime); #endif } +#if !defined(NDEBUG) && defined(OUTPUT_DBG_INFO) std::string GetStatus() { std::string result; @@ -549,11 +550,12 @@ public: return result; } +#endif // #if !defined(NDEBUG) && defined(OUTPUT_DBG_INFO) protected: void TurnOn() { -#ifdef OUTPUT_DBG_INFO +#if !defined(NDEBUG) || defined(OUTPUT_DBG_INFO) std::string status = GetStatus(); XYLOG(XYLOG_SEVERITY_INFO, "PWR Before TurnOn %s", status.c_str()); #endif diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index dbc3bedd..90454a8f 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1585,10 +1585,15 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c // timeout m_ethernetFailures++; +#if !defined(NDEBUG) && defined(OUTPUT_DBG_INFO) std::string pwrStatus = powerCtrlPtr->GetStatus(); pwrStatus += ethernetPowerCtrl->GetStatus(); XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet Not Existing CH=%u PR=%X PHOTOID=%u EthFailures=%u PWR:%s", (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId, m_ethernetFailures, pwrStatus.c_str()); +#else + XYLOG(XYLOG_SEVERITY_ERROR, "Ethernet Not Existing CH=%u PR=%X PHOTOID=%u EthFailures=%u", + (uint32_t)localPhotoInfo.channel, (uint32_t)localPhotoInfo.preset, localPhotoInfo.photoId, m_ethernetFailures); +#endif TakePhotoCb(0, localPhotoInfo, "", 0); if (m_ethernetFailures > 3) {