mrDarker
2025-09-12 d89cc31a84312a4fde459dc82f29306e24750d4b
SourceCode/Bond/Servo/CEqReadStep.cpp
@@ -38,18 +38,29 @@
      CReadStep::onReadData();
      // 20250620新增,有些场景是不需要读数据的,只要检测到信息就写数据给机器
      if (m_nReadSize == 0) {
         if (m_onReadBlock != nullptr) {
            m_onReadBlock(this, ROK, nullptr, 0);
         }
         return 0;
      }
      // 读数据
      char szBuffer[READ_BUFFER_MAX];
      int nRet = m_pCclink->ReadData2(m_station, DeviceType::W, m_nDataDev,
         (long)min(READ_BUFFER_MAX, m_nReadSize), szBuffer);
      if (0 != nRet) {
         LOGI("<CEqReadStep>Read data error.");
         LOGE("<CEqReadStep>Read data error.");
         if (m_onReadBlock != nullptr) {
            m_onReadBlock(this, RERROR, nullptr, 0);
         }
         return -1;
      }
      LOGI("<CEqReadStep>read data succeed.");
      LOGD("<CEqReadStep>read data succeed.");
      if (m_onReadBlock != nullptr) {
         m_onReadBlock(this, ROK, szBuffer, m_nReadSize);
      }
@@ -61,7 +72,7 @@
   int CEqReadStep::onComplete()
   {
      CReadStep::onComplete();
      LOGI("<CEqReadStep> onComplete.");
      LOGD("<CEqReadStep> onComplete.");
      if (m_onReadBlock != nullptr) {
         m_onReadBlock(this, RCOMPLETE, nullptr, 0);
      }
@@ -72,7 +83,7 @@
   int CEqReadStep::onTimeout()
   {
      CReadStep::onTimeout();
      LOGI("<CEqReadStep> onTimeout.");
      LOGE("<CEqReadStep> onTimeout.");
      if (m_onReadBlock != nullptr) {
         m_onReadBlock(this, RTIMEOUT, nullptr, 0);
      }