|
|
@ -40,15 +40,20 @@ TransmitDisinfection::TransmitDisinfection(QWidget *parent) : QTabWidget(parent) |
|
|
|
ErrorCodeInitializer().regErrorcodeInfo(); |
|
|
|
|
|
|
|
CAN_MASTER->getCanProtocolCom()->regOnRawData([this](packet_type_t type, uint8_t from, uint8_t to, uint8_t *hex, uint32_t hexlen) { |
|
|
|
zcanbus_packet_t *frame = (zcanbus_packet_t *)hex; |
|
|
|
int paramLen = hexlen - sizeof(*frame); |
|
|
|
if (type == kcmd) { |
|
|
|
zcanbus_packet_t *frame = (zcanbus_packet_t *)hex; |
|
|
|
BSHOW("[CMD ] [%d->%d],%s", from, to, zhex2str(hex, hexlen).c_str()); //
|
|
|
|
BSHOW("[CMD ] [%d->%d],%s %s(%d)", from, to, zhex2str(hex, sizeof(*frame)).c_str(), //
|
|
|
|
zhex2str(frame->params, paramLen).c_str(), paramLen); //
|
|
|
|
} else if (type == kerror_receipt) { |
|
|
|
BSHOW("[E-RECEIPT] [%d->%d],%s", from, to, zhex2str(hex, hexlen).c_str()); //
|
|
|
|
BSHOW("[E-RECEIPT] [%d->%d],%s %s(%d)", from, to, zhex2str(hex, sizeof(*frame)).c_str(), //
|
|
|
|
zhex2str(frame->params, paramLen).c_str(), paramLen); //
|
|
|
|
} else if (type == kreceipt) { |
|
|
|
BSHOW("[RECEIPT ] [%d->%d],%s", from, to, zhex2str(hex, hexlen).c_str()); //
|
|
|
|
BSHOW("[RECEIPT ] [%d->%d],%s %s(%d)", from, to, zhex2str(hex, sizeof(*frame)).c_str(), //
|
|
|
|
zhex2str(frame->params, paramLen).c_str(), paramLen); //
|
|
|
|
} else if (type == kreport) { |
|
|
|
BSHOW("[REPORT ] [%d->%d],%s", from, to, zhex2str(hex, hexlen).c_str()); //
|
|
|
|
BSHOW("[REPORT ] [%d->%d],%s %s(%d)", from, to, zhex2str(hex, sizeof(*frame)).c_str(), //
|
|
|
|
zhex2str(frame->params, paramLen).c_str(), paramLen); //
|
|
|
|
} |
|
|
|
processReportPacket(type, from, to, hex, hexlen); |
|
|
|
}); |
|
|
|