Remove restrictions from slot delete

This commit is contained in:
Augusto Zanellato
2023-08-22 23:30:33 +02:00
parent 95aded8267
commit 5f27cef975
4 changed files with 5 additions and 13 deletions
+1
View File
@@ -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)
+2 -7
View File
@@ -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);
}
+2 -4
View File
@@ -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")
print(" - Successfully set button function to settings")
-2
View File
@@ -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: