diff --git a/firmware/application/src/app_cmd.c b/firmware/application/src/app_cmd.c index f9b8ee0d..42b0b67b 100644 --- a/firmware/application/src/app_cmd.c +++ b/firmware/application/src/app_cmd.c @@ -235,12 +235,8 @@ static data_frame_tx_t *cmd_processor_hf14a_scan(uint16_t cmd, uint16_t status, } static data_frame_tx_t *cmd_processor_mf1_detect_support(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) { - uint8_t support; - status = check_std_mifare_nt_support((bool *)&support); - if (status != HF_TAG_OK) { - return data_frame_make(cmd, status, 0, NULL); - } - return data_frame_make(cmd, HF_TAG_OK, sizeof(support), &support); + status = check_std_mifare_nt_support(); + return data_frame_make(cmd, status, 0, NULL); } static data_frame_tx_t *cmd_processor_mf1_detect_prng(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) { diff --git a/firmware/application/src/rfid/reader/hf/mf1_toolbox.c b/firmware/application/src/rfid/reader/hf/mf1_toolbox.c index 473262fc..e8906345 100644 --- a/firmware/application/src/rfid/reader/hf/mf1_toolbox.c +++ b/firmware/application/src/rfid/reader/hf/mf1_toolbox.c @@ -609,7 +609,7 @@ uint8_t check_tag_response_nt(picc_14a_tag_t *tag, uint32_t *nt) { * Lost card hf_tag_no and wrong status hf_errstat * */ -uint8_t check_std_mifare_nt_support(bool *support) { +uint8_t check_std_mifare_nt_support(void) { uint32_t nt1 = 0; // Find card, search on the field @@ -617,13 +617,8 @@ uint8_t check_std_mifare_nt_support(bool *support) { return HF_TAG_NO; } - // Get NT - uint8_t status = check_tag_response_nt(p_tag_info, &nt1); - if (status == HF_TAG_NO) { - return HF_TAG_NO; - } - *support = status == HF_TAG_OK; - return HF_TAG_OK; + // Get NT and return status + return check_tag_response_nt(p_tag_info, &nt1); } /** diff --git a/firmware/application/src/rfid/reader/hf/mf1_toolbox.h b/firmware/application/src/rfid/reader/hf/mf1_toolbox.h index 0f28a26f..48dfb7cd 100644 --- a/firmware/application/src/rfid/reader/hf/mf1_toolbox.h +++ b/firmware/application/src/rfid/reader/hf/mf1_toolbox.h @@ -91,7 +91,7 @@ uint8_t nested_recover_key(NESTED_CORE_PARAM_DEF, mf1_nested_core_t ncs[SETS_NR] uint8_t static_nested_recover_key(NESTED_CORE_PARAM_DEF, mf1_static_nested_core_t *sncs); uint8_t check_prng_type(mf1_prng_type_t *type); -uint8_t check_std_mifare_nt_support(bool *support); +uint8_t check_std_mifare_nt_support(); void antenna_switch_delay(uint32_t delay_ms); uint8_t auth_key_use_522_hw(uint8_t block, uint8_t type, uint8_t *key); diff --git a/software/script/chameleon_cmd.py b/software/script/chameleon_cmd.py index 367e78f6..5417e42b 100644 --- a/software/script/chameleon_cmd.py +++ b/software/script/chameleon_cmd.py @@ -508,16 +508,13 @@ def hf14a_scan(self): resp.data = data return resp - @expect_response(chameleon_status.Device.HF_TAG_OK) def mf1_detect_support(self): """ Detect whether it is mifare classic tag :return: """ resp = self.device.send_cmd_sync(DATA_CMD_MF1_DETECT_SUPPORT) - if resp.status == chameleon_status.Device.HF_TAG_OK: - resp.data, = struct.unpack('!?', resp.data) - return resp + return resp.status == chameleon_status.Device.HF_TAG_OK @expect_response(chameleon_status.Device.HF_TAG_OK) def mf1_detect_prng(self):