Browse Source

update

master
zhaohe 2 years ago
parent
commit
b6a5e4234a
  1. 2
      components/zcancmder/zcanreceiver_master.cpp
  2. 12
      components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp

2
components/zcancmder/zcanreceiver_master.cpp

@ -151,7 +151,7 @@ int32_t ZCanCommnaderMaster::sendCmd(int32_t cmdid, int32_t submoduleid, int32_t
int32_t *rxbuf = report->get_data_as<int32_t>(); int32_t *rxbuf = report->get_data_as<int32_t>();
if (ack != nullptr && nack != 0) { if (ack != nullptr && nack != 0) {
for (size_t i = 0; i < nack; i++) { for (size_t i = 0; i < nack; i++) {
ZLOGI(TAG, "ack[%d] = %d", i, rxbuf[i]);
// ZLOGI(TAG, "ack[%d] = %d", i, rxbuf[i]);
ack[i] = rxbuf[i]; ack[i] = rxbuf[i];
} }
} }

12
components/zprotocol_helper/micro_computer_module_device_script_cmder_paser.cpp

@ -4,8 +4,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "sdk\components\zprotocols\zcancmder_v2\api\state_index.hpp"
#include "sdk/os/zos.hpp" #include "sdk/os/zos.hpp"
#include "sdk\components\zprotocols\zcancmder_v2\api\state_index.hpp"
using namespace iflytop; using namespace iflytop;
using namespace std; using namespace std;
@ -13,8 +13,11 @@ using namespace std;
void MicroComputerModuleDeviceScriptCmderPaser::do_dumpconfig(int32_t moduleId) { void MicroComputerModuleDeviceScriptCmderPaser::do_dumpconfig(int32_t moduleId) {
ICmdParserACK ack; ICmdParserACK ack;
const char paraV[1][10] = {{0}};
sprintf((char*)paraV[0], "%d", moduleId);
const char paraV_cache[1][10] = {{0}};
sprintf((char*)paraV_cache[0], "%ld", moduleId);
// sprintf((char*)&paraV[0][0], "%d", moduleId);
const char* paraV[1] = {paraV_cache[0]};
do_dumpconfig(1, (const char**)paraV, &ack); do_dumpconfig(1, (const char**)paraV, &ack);
} }
@ -26,10 +29,11 @@ void MicroComputerModuleDeviceScriptCmderPaser::do_dumpconfig(int32_t paramN, co
uint16_t moduleId = atoi(paraV[0]); uint16_t moduleId = atoi(paraV[0]);
int32_t configval = 0; int32_t configval = 0;
int32_t ecode = 0; int32_t ecode = 0;
ZLOGI(TAG, "dumpconfig %s", paraV[0]);
#define DUMP_CONFIG(tag, configid) \ #define DUMP_CONFIG(tag, configid) \
ecode = m_deviceManager->module_get_param(moduleId, configid, &configval); \ ecode = m_deviceManager->module_get_param(moduleId, configid, &configval); \
if (ecode != 0) { \
if (ecode == 0) { \
ZLOGI(TAG, "%-30s :%d", tag, configval); \ ZLOGI(TAG, "%-30s :%d", tag, configval); \
} }

Loading…
Cancel
Save