From 775de7afdb9f3e62ff57381811602b079b6cd907 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 23 Aug 2024 21:43:21 +0800 Subject: [PATCH] v1.0.3 --- README.md | 3 +++ app_protocols/zscanprotocol | 2 +- appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp | 7 +++++-- .../appcomponents/canchannel/transmit_disinfection_can_master.hpp | 3 +-- appsrc/appsetting/project_port/basic/zappversion.hpp | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 12df707..309dee0 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,7 @@ ``` VERSION 1.0.1 1. 修复nlog 打印时,使用{:.f}导致的异常错误 +VERSION 1.0.3 + 1. 修改默认超时时间为500ms + 2. 添加对subdevice_overtimes的处理 ``` \ No newline at end of file diff --git a/app_protocols/zscanprotocol b/app_protocols/zscanprotocol index d11d41c..8a3aeaf 160000 --- a/app_protocols/zscanprotocol +++ b/app_protocols/zscanprotocol @@ -1 +1 @@ -Subproject commit d11d41c1062568f629d5ec2bc6435319b7ea83e3 +Subproject commit 8a3aeaf8883a3c7d01594e0399fbe96bf8b9cf72 diff --git a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp index 8ef715d..eaae7da 100644 --- a/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp +++ b/appsrc/appcomponents/canchannel/com/zscanprotocol_com.cpp @@ -195,7 +195,7 @@ shared_ptr ZSCanProtocolCom::base_callcmd(int32_t to, int32_t cmdid, ui shared_ptr ZSCanProtocolCom::callcmd(int32_t to, int32_t cmdid, uint8_t *param, int32_t paramLen, int32_t overtime) { shared_ptr receipt; - lock_guard lock(m_lock); + lock_guard lock(m_lock); usleep(10 * 1000); for (size_t i = 0; i <= 3; i++) { @@ -203,10 +203,13 @@ shared_ptr ZSCanProtocolCom::callcmd(int32_t to, int32_t cmdid, uint8_t receipt = base_callcmd(to, cmdid, param, paramLen, overtime); } catch (const appexception &e) { if (e.ecode == err::kerr_overtime) { - // sl if (i != 0) logger->warn("callcmd cmdid[{}] to [{}] overtime, retry {}", cmdid, to, i); usleep(100 * 1000); continue; + } else if (e.ecode == err::kerr_subdevice_overtime) { + if (i != 0) logger->warn("callcmd cmdid[{}] to [{}] subdevice_overtime, retry {}", cmdid, to, i); + usleep(100 * 1000); + continue; } throw; } diff --git a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp index fbe6752..c6a7ef7 100644 --- a/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp +++ b/appsrc/appcomponents/canchannel/transmit_disinfection_can_master.hpp @@ -15,7 +15,7 @@ // #include "app_protocols/transmit_disfection_protocol/transmit_disfection_protocol.hpp" #include "appcomponents/canchannel/com/zscanprotocol_com.hpp" -#define DEFUALT_OVERTIME 100 +#define DEFUALT_OVERTIME 500 namespace iflytop { using namespace std; @@ -125,7 +125,6 @@ class TransmitDisinfectionCanMaster { int proportionalReadPos(int boardid, int valveId) { return m_com->callcmd1(boardid, kfn_proportional_read_pos, valveId, DEFUALT_OVERTIME)->getContent(0); } int proportionalIsBusy(int boardid, int valveId) { return m_com->callcmd1(boardid, kfn_proportional_is_busy, valveId, DEFUALT_OVERTIME)->getContent(0); } - void airLeakDetectTestSetMode(int boardid, int mode) { m_com->callcmd1(boardid, kfn_air_leak_detect_test_set_mode, mode, DEFUALT_OVERTIME); } int airLeakDetectTestGetMode(int boardid) { return m_com->callcmd0(boardid, kfn_air_tightness_test_get_mode, DEFUALT_OVERTIME)->getContent(0); } diff --git a/appsrc/appsetting/project_port/basic/zappversion.hpp b/appsrc/appsetting/project_port/basic/zappversion.hpp index 61434cb..5bd896f 100644 --- a/appsrc/appsetting/project_port/basic/zappversion.hpp +++ b/appsrc/appsetting/project_port/basic/zappversion.hpp @@ -1,3 +1,3 @@ #pragma once -#define VERSION "1.0.2" +#define VERSION "1.0.3" #define PROJECT_NAME "TRANSMIT_DM" \ No newline at end of file