|
|
@ -27,8 +27,8 @@ void M3078CodeScanner::initialize(int moduleid, hardware_config_t* hardwareconfi |
|
|
|
}); |
|
|
|
m_uart.startRxIt(); |
|
|
|
m_triggerGpio.initAsOutput(hardwareconfig->triggerPin, ZGPIO::kMode_nopull, true, false); |
|
|
|
//creg.module_enable = 1;
|
|
|
|
id = moduleid; |
|
|
|
// creg.module_enable = 1;
|
|
|
|
id = moduleid; |
|
|
|
} |
|
|
|
void M3078CodeScanner::trigger() { |
|
|
|
ZLOGI(TAG, "trigger"); |
|
|
@ -56,27 +56,29 @@ int32_t M3078CodeScanner::module_stop() { |
|
|
|
stopTrigger(); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t M3078CodeScanner::module_break() { |
|
|
|
|
|
|
|
int32_t M3078CodeScanner::code_scaner_start_scan() { |
|
|
|
trigger(); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t M3078CodeScanner::code_scaner_stop_scan() { |
|
|
|
stopTrigger(); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t M3078CodeScanner::module_start() { |
|
|
|
trigger(); |
|
|
|
int32_t M3078CodeScanner::code_scaner_result_is_ready(int32_t* ready) { |
|
|
|
*ready = read_status(); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t M3078CodeScanner::module_get_status(int32_t* status) { |
|
|
|
*status = read_status(); |
|
|
|
int32_t M3078CodeScanner::code_scaner_get_result_length(int32_t* length) { |
|
|
|
*length = getIdinfoLen(); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int32_t M3078CodeScanner::module_read_raw(int32_t startadd, uint8_t* data, int32_t* len) { |
|
|
|
ZLOGI(TAG, "module_read_raw"); |
|
|
|
int32_t M3078CodeScanner::code_scaner_read_scaner_result(uint8_t* result, int32_t* len) { |
|
|
|
if (codecachelen > *len) { |
|
|
|
return err::kbuffer_not_enough; |
|
|
|
} |
|
|
|
*len = codecachelen; |
|
|
|
memcpy(data, codecache, codecachelen); |
|
|
|
memcpy(result, codecache, codecachelen); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
int32_t M3078CodeScanner::get_id_info_len(int32_t* len) { |
|
|
@ -90,9 +92,6 @@ int32_t M3078CodeScanner::get_raw_sector_num(int32_t* num) { |
|
|
|
int32_t M3078CodeScanner::module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
switch (param_id) { |
|
|
|
MODULE_COMMON_PROCESS_REG_CB(); |
|
|
|
// PROCESS_REG(kreg_module_raw_sector_size, /* */ get_id_info_len(&val), ACTION_NONE);
|
|
|
|
// PROCESS_REG(kreg_module_raw_sector_num, /* */ get_raw_sector_num(&val), ACTION_NONE);
|
|
|
|
|
|
|
|
default: |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
break; |
|
|
|