|
@ -1,6 +1,7 @@ |
|
|
#include "zcan_protocol_parser.hpp"
|
|
|
#include "zcan_protocol_parser.hpp"
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
#include "sdk/os/zos.hpp"
|
|
|
#include "sdk/os/zos.hpp"
|
|
|
|
|
|
|
|
@ -133,6 +134,8 @@ void ZCanProtocolParser::_onRceivePacket(ZIModule* module, zcr_cmd_header_t* rxc |
|
|
cxt.acklen = 0; |
|
|
cxt.acklen = 0; |
|
|
cxt.ackbuf = ackbuf; |
|
|
cxt.ackbuf = ackbuf; |
|
|
|
|
|
|
|
|
|
|
|
memset(ackbuf, 0, sizeof(ackbuf)); |
|
|
|
|
|
|
|
|
int32_t ecode = fn->cb(&cxt); |
|
|
int32_t ecode = fn->cb(&cxt); |
|
|
if (ecode != 0) { |
|
|
if (ecode != 0) { |
|
|
m_cancmder->sendErrorAck(rxcmd, ecode); |
|
|
m_cancmder->sendErrorAck(rxcmd, ecode); |
|
@ -147,9 +150,9 @@ void ZCanProtocolParser::_onRceivePacket(ZIModule* module, zcr_cmd_header_t* rxc |
|
|
if (module == nullptr) return err::koperation_not_support; \ |
|
|
if (module == nullptr) return err::koperation_not_support; \ |
|
|
if (paraNum >= 0 && paraNum != cxt->paramlen / 4) return err::kcmd_param_num_error; |
|
|
if (paraNum >= 0 && paraNum != cxt->paramlen / 4) return err::kcmd_param_num_error; |
|
|
|
|
|
|
|
|
#define GET_MODULE(paraNum) \
|
|
|
|
|
|
auto* module = dynamic_cast<MODULE_CLASS*>(cxt->module); \ |
|
|
|
|
|
if (module == nullptr) return err::koperation_not_support; |
|
|
|
|
|
|
|
|
#define GET_MODULE(paraNum) \
|
|
|
|
|
|
auto* module = dynamic_cast<MODULE_CLASS*>(cxt->module); \ |
|
|
|
|
|
if (module == nullptr) return err::koperation_not_support; |
|
|
|
|
|
|
|
|
#define MODULE_CLASS ZIModule
|
|
|
#define MODULE_CLASS ZIModule
|
|
|
int32_t ZCanProtocolParser::module_ping(cmdcontxt_t* cxt) { |
|
|
int32_t ZCanProtocolParser::module_ping(cmdcontxt_t* cxt) { |
|
|