Skip to content

Commit

Permalink
Merge pull request #84 from augustozanellato/rework_st_delete
Browse files Browse the repository at this point in the history
Remove restrictions from slot delete
  • Loading branch information
doegox authored Aug 22, 2023
2 parents 989c723 + fdc269a commit 40b90ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- Refactor CI pipeline. (@augustozanellato)
- Added offline copy EM card uid for btnpress.(@nemanjan00)
- Added offline copy ic card uid for btnpress.(@xianglin1998)
Expand Down
9 changes: 2 additions & 7 deletions firmware/application/src/app_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions software/script/chameleon_cli_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,7 @@ def on_exec(self, args: argparse.Namespace):
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
Expand Down Expand Up @@ -1329,4 +1327,4 @@ def on_exec(self, args: argparse.Namespace):
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 changes: 0 additions & 2 deletions software/script/chameleon_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,6 @@ def set_slot_tag_type(self, slot_index: SlotNumber, tag_type: TagSpecificType):
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:
Expand Down

0 comments on commit 40b90ac

Please sign in to comment.