diff --git a/a8000_protocol b/a8000_protocol index 5c4075a..5ed4730 160000 --- a/a8000_protocol +++ b/a8000_protocol @@ -1 +1 @@ -Subproject commit 5c4075ae36cb16b5a1b86fc860a39a8217d2a2c8 +Subproject commit 5ed47307b153a256e90fc5031b58ff65102a7f03 diff --git a/iflytop_canbus/iflytop_canbus_master.cpp b/iflytop_canbus/iflytop_canbus_master.cpp index c8dcea8..0bdaaf1 100644 --- a/iflytop_canbus/iflytop_canbus_master.cpp +++ b/iflytop_canbus/iflytop_canbus_master.cpp @@ -154,7 +154,7 @@ void IflytopCanbusMaster::callcmd(int32_t device_id, int32_t cmdid, uint8_t *par } frame->packetindex = m_txindex; - frame->subModuleid = device_id; + frame->moduleid = device_id; frame->packetType = kptv2_cmd; if (paramLen != 0) memcpy(frame->data, param, paramLen); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1343533..e516a9c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -174,7 +174,7 @@ static const char *fmt(const char *fmt, ...) { void MainWindow::parse_ptv2_cmd(zcr_cmd_header_t *frame, int32_t packetlen) { int cmdId = frame->cmdMainId * 256 + frame->cmdSubId; - int32_t mid = frame->subModuleid; + int32_t mid = frame->moduleid; int32_t *param = (int32_t *)frame->data; if (cmdId == kmodule_set_reg) { @@ -188,7 +188,7 @@ void MainWindow::parse_ptv2_cmd(zcr_cmd_header_t *frame, int32_t packetlen) { } void MainWindow::parse_ptv2_ack(zcr_cmd_header_t *frame, int32_t packetlen) { int cmdId = frame->cmdMainId * 256 + frame->cmdSubId; - int32_t mid = frame->subModuleid; + int32_t mid = frame->moduleid; int32_t *param = (int32_t *)frame->data; if (kptv2_error_ack == frame->packetType) { ZQUI::ins()->rawshow("[E-RECEI] %s(%d)", err::error2str(param[0]), param[0]); @@ -198,11 +198,12 @@ void MainWindow::parse_ptv2_ack(zcr_cmd_header_t *frame, int32_t packetlen) { } void MainWindow::parse_ptv2_event(zcr_cmd_header_t *frame, int32_t packetlen) { int cmdId = frame->cmdMainId * 256 + frame->cmdSubId; - int32_t mid = frame->subModuleid; + int32_t mid = frame->moduleid; int32_t *param = (int32_t *)frame->data; int32_t paramLen = packetlen - sizeof(zcr_cmd_header_t); - ZQUI::ins()->rawshow("[EVENT ] id:%d e:%s(%d) p:%s(%d)", mid, cmdid2str(cmdId), cmdId, zhex2str(frame->data,paramLen ), paramLen); + ZQUI::ins()->rawshow("[EVENT ] raw:%s[id:%d e:%s(0x%04x) p:%s(%d)]", zhex2str((uint8_t *)frame, packetlen).c_str(), // + mid, cmdid2str(cmdId), cmdId, zhex2str(frame->data, paramLen).c_str(), paramLen); } MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {