From 5f27cef975972967dd6bbff00fc349b71d670254 Mon Sep 17 00:00:00 2001 From: Augusto Zanellato Date: Tue, 22 Aug 2023 23:28:37 +0200 Subject: [PATCH] Remove restrictions from slot delete --- CHANGELOG.md | 1 + firmware/application/src/app_cmd.c | 9 ++------- software/script/chameleon_cli_unit.py | 6 ++---- software/script/chameleon_cmd.py | 2 -- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d90d2..bbd671d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Changed `hw slot delete`, now it can always delete from slot. (@augustozanellato) - Added offline copy EM card uid for btnpress.(@nemanjan00) - Added offline copy ic card uid for btnpress.(@xianglin1998) - Added `hw settings btnpress` to get and set button press function.(@xianglin1998) diff --git a/firmware/application/src/app_cmd.c b/firmware/application/src/app_cmd.c index 95b8d36..d948b9c 100644 --- a/firmware/application/src/app_cmd.c +++ b/firmware/application/src/app_cmd.c @@ -342,14 +342,9 @@ data_frame_tx_t* cmd_processor_delete_slot_sense_type(uint16_t cmd, uint16_t sta if (length == 2 && data[0] < TAG_MAX_SLOT_NUM && (data[1] == TAG_SENSE_HF || data[1] == TAG_SENSE_LF)) { uint8_t slot_num = data[0]; uint8_t sense_type = data[1]; - uint8_t other_st_index = sense_type == TAG_SENSE_LF ? 0 : 1; - tag_specific_type_t tag_types[2]; - tag_emulation_get_specific_type_by_slot(slot_num, tag_types); - if (tag_types[other_st_index] != TAG_TYPE_UNKNOWN) { - tag_emulation_delete_data(slot_num, sense_type); - status = STATUS_DEVICE_SUCCESS; - } + tag_emulation_delete_data(slot_num, sense_type); + status = STATUS_DEVICE_SUCCESS; } return data_frame_make(cmd, status, 0, NULL); } diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index a31eacf..95d97df 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -1017,9 +1017,7 @@ class HWSlotTagType(TagTypeRequiredUnit, SlotIndexRequireUnit): class HWDeleteSlotSense(SlotIndexRequireUnit, SenseTypeRequireUnit): def args_parser(self) -> ArgumentParserNoExit: parser = ArgumentParserNoExit() - parser.description = "Delete sense type data for a specific slot. " \ - "The slot needs to have the other sense type correctly configured, " \ - "otherwise an error will be thrown." + parser.description = "Delete sense type data for a specific slot." self.add_slot_args(parser) self.add_sense_type_args(parser) return parser @@ -1329,4 +1327,4 @@ class HWButtonSettingsSet(DeviceRequiredUnit): button = chameleon_cmd.ButtonType.from_str(args.b) function = chameleon_cmd.ButtonPressFunction.from_int(args.f) self.cmd.set_button_press_fun(button, function) - print(" - Successfully set button function to settings") \ No newline at end of file + print(" - Successfully set button function to settings") diff --git a/software/script/chameleon_cmd.py b/software/script/chameleon_cmd.py index 06bc461..66f09c2 100644 --- a/software/script/chameleon_cmd.py +++ b/software/script/chameleon_cmd.py @@ -511,8 +511,6 @@ class ChameleonCMD: def delete_slot_sense_type(self, slot_index: SlotNumber, sense_type: TagSenseType): """ Delete a sense type for a specific slot. - Another sense type must be enabled for the same slot, - otherwise an error will be thrown. :param slot_index: Slot index :param sense_type: Sense type to disable :return: