LAPTOP-SNT8I5JK\Boounion
2025-02-15 f8971cfc3abcc23fd2a5541a7bf698389d5e9300
SourceCode/Bond/Servo/Model.cpp
@@ -57,6 +57,33 @@
   });
   SECSListener listener;
   listener.onEQOffLine = [&](void* pFrom) -> void {
      LOGI("远程请求OffLine");
   };
   listener.onEQOnLine = [&](void* pFrom) -> void {
      LOGI("远程请求OnLine");
   };
   listener.onCommand = [&](void* pFrom, const char* pszName, std::vector<CommandParameter>& params) -> void {
      LOGI("onCommand:%s", pszName);
      for (auto& item : params) {
         LOGI("param:%s,%s", item.szName, item.szValue);
      }
   };
   listener.onEQConstantRequest = [&](void* pFrom, std::vector<EQConstant>& eqcs) -> void {
      // 在此填充常量值,目前仅是加1后返回
      for (auto& item : eqcs) {
         sprintf_s(item.szValue, 256, "Test%d", item.id+1);
      }
   };
   listener.onEQConstantSend = [&](void* pFrom, std::vector<EQConstant>& eqcs) -> void {
      // 在此保存和设置机器常量值
      for (auto& item : eqcs) {
         LOGI("onEQConstantRequest: %d, %s", item.id, item.szValue);
      }
   };
   m_hsmsPassive.setListener(listener);
   m_hsmsPassive.setEquipmentModelType((LPTSTR)(LPCTSTR)strModeType);
   m_hsmsPassive.setSoftRev((LPTSTR)(LPCTSTR)strSoftRev);
   m_hsmsPassive.init(this, "APP", 7000);
@@ -69,6 +96,8 @@
{
   m_hsmsPassive.term();
   CLog::GetLog()->SetOnLogCallback(nullptr);
   m_master.term();
   return 0;
}