|
@ -116,6 +116,15 @@ void ZCanProtocolParser::initialize(IZCanReceiver* cancmder) { |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
REGFN(a8000_idcard_reader_read_raw); |
|
|
REGFN(a8000_idcard_reader_read_raw); |
|
|
|
|
|
|
|
|
|
|
|
REGFN(plate_code_scaner_start_scan); |
|
|
|
|
|
REGFN(plate_code_scaner_stop_scan); |
|
|
|
|
|
REGFN(plate_code_scaner_read_result); |
|
|
|
|
|
REGFN(plate_code_scaner_read_result_packet_num); |
|
|
|
|
|
REGFN(plate_code_scaner_read_code); |
|
|
|
|
|
REGFN(plate_code_scaner_adc_readraw); |
|
|
|
|
|
REGFN(plate_code_scaner_open_laser); |
|
|
|
|
|
REGFN(plate_code_scaner_close_laser); |
|
|
} |
|
|
} |
|
|
void ZCanProtocolParser::_registerModule(uint16_t id, ZIModule* module) { m_modulers[id] = module; } |
|
|
void ZCanProtocolParser::_registerModule(uint16_t id, ZIModule* module) { m_modulers[id] = module; } |
|
|
void ZCanProtocolParser::registerModule(ZIModule* module) { |
|
|
void ZCanProtocolParser::registerModule(ZIModule* module) { |
|
@ -731,4 +740,64 @@ int32_t ZCanProtocolParser::a8000_idcard_reader_read_raw(cmdcontxt_t* cxt) { |
|
|
} |
|
|
} |
|
|
#undef MODULE_CLASS
|
|
|
#undef MODULE_CLASS
|
|
|
|
|
|
|
|
|
|
|
|
#define MODULE_CLASS ZI_PlateCodeScanerModule
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_start_scan(int32_t startpos) = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_stop_scan() = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_read_result(int32_t packetIndex, uint8_t* data, int32_t* len) = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_read_result_packet_num(int32_t* packetNum) = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_read_code(int32_t* code0, int32_t* code1) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_adc_readraw(int32_t* val) = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_open_laser() = 0;
|
|
|
|
|
|
// virtual int32_t plate_code_scaner_close_laser() = 0;
|
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_start_scan(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(1); |
|
|
|
|
|
return module->plate_code_scaner_start_scan(cxt->params[0]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_stop_scan(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
return module->plate_code_scaner_stop_scan(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_read_result(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(1); |
|
|
|
|
|
cxt->acklen = ZCANCMD_READ_BUF_MAX_SIZE; |
|
|
|
|
|
int32_t suc = module->plate_code_scaner_read_result(cxt->params[0], cxt->ackbuf, &cxt->acklen); |
|
|
|
|
|
if (suc != 0) { |
|
|
|
|
|
cxt->acklen = 0; |
|
|
|
|
|
} |
|
|
|
|
|
return suc; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_read_result_packet_num(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
int32_t* ack = (int32_t*)cxt->ackbuf; |
|
|
|
|
|
cxt->acklen = 4; |
|
|
|
|
|
return module->plate_code_scaner_read_result_packet_num(&ack[0]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_read_code(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
return module->plate_code_scaner_read_code(&cxt->params[0], &cxt->params[1]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_adc_readraw(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
int32_t* ack = (int32_t*)cxt->ackbuf; |
|
|
|
|
|
cxt->acklen = 4; |
|
|
|
|
|
return module->plate_code_scaner_adc_readraw(&ack[0]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_open_laser(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
return module->plate_code_scaner_open_laser(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t ZCanProtocolParser::plate_code_scaner_close_laser(cmdcontxt_t* cxt) { |
|
|
|
|
|
CHECK_AND_GET_MODULE(0); |
|
|
|
|
|
return module->plate_code_scaner_close_laser(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif
|
|
|
#endif
|