From ba9be075527cc434566ff366d629a1a267cc78e7 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 18 Nov 2023 20:00:12 +0800 Subject: [PATCH 1/2] update --- .../micro_computer_module_device_script_cmder_paser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp index 63fe66c..1548c9a 100644 --- a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp +++ b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp @@ -58,7 +58,7 @@ void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, }); deviceManager->regOnRegValChangeEvent([this](int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) { // - ZLOGI(TAG, "onRegValChangeEvent(%d,%d,%d->%d)", moduleid, regindex, oldval,toval); + ZLOGI(TAG, "onRegValChangeEvent(%d,%d,%d->%d)", moduleid, regindex, oldval, toval); }); } @@ -472,4 +472,5 @@ void MicroComputerModuleDeviceScriptCmderPaser::do_scan_module(int32_t paramN, c ZLOGI(TAG, "module %d : %s", id, ecode == 0 ? "online" : "offline"); } }); + ZLOGI(TAG, "scan module end..."); } From 420c8ee0deae6af76db7e82e3cbb9c1433e5666f Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 18 Nov 2023 20:48:16 +0800 Subject: [PATCH 2/2] fix some bug --- components/zcancmder/basic.cpp | 2 +- .../micro_computer_module_device_script_cmder_paser.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/zcancmder/basic.cpp b/components/zcancmder/basic.cpp index 49e6084..e5db66b 100644 --- a/components/zcancmder/basic.cpp +++ b/components/zcancmder/basic.cpp @@ -29,7 +29,7 @@ uint8_t *CanPacketRxBuffer::get_data() { uint16_t CanPacketRxBuffer::get_datalen() { return rxdataSize - sizeof(zcr_cmd_header_t); } void CanPacketRxBuffer::clear() { id = 0; - memset(&m_canPacket, 0, sizeof(m_canPacket) * sizeof(m_canPacket[0])); + memset(&m_canPacket, 0, sizeof(m_canPacket) / sizeof(m_canPacket[0])); m_canPacketNum = 0; m_npacket = 0; memset(rxdata, 0, sizeof(rxdata)); diff --git a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp index 1548c9a..6fbb2e2 100644 --- a/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp +++ b/components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp @@ -467,6 +467,7 @@ void MicroComputerModuleDeviceScriptCmderPaser::do_wait_for_module(int32_t modul void MicroComputerModuleDeviceScriptCmderPaser::do_scan_module(int32_t paramN, const char* paraV[], ICmdParserACK* ack) { m_deviceManager->for_each_module([this](int32_t id) { // + // ZLOGI(TAG, "ping %d", id); int32_t ecode = m_deviceManager->module_ping(id); if (ecode == 0) { ZLOGI(TAG, "module %d : %s", id, ecode == 0 ? "online" : "offline");