cmdhfseos less verbose args parsing

This commit is contained in:
Jakub Kramarz 2025-01-27 10:27:47 +01:00
commit e3e9ca504e

View file

@ -1636,8 +1636,6 @@ static int CmdHfSeosSAM(const char *Cmd) {
"hd seos sam -d a005a103800104 -> get PACS data\n" "hd seos sam -d a005a103800104 -> get PACS data\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_lit0("v", "verbose", "verbose output"), arg_lit0("v", "verbose", "verbose output"),
@ -1649,22 +1647,10 @@ static int CmdHfSeosSAM(const char *Cmd) {
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
bool verbose = false; bool verbose = arg_get_lit(ctx, 1);
if (arg_get_lit(ctx, 1)) { bool disconnectAfter = !arg_get_lit(ctx, 2);
verbose = true; bool skipDetect = arg_get_lit(ctx, 3);
} bool decodeTLV = arg_get_lit(ctx, 4);
bool disconnectAfter = true;
if (arg_get_lit(ctx, 2)) {
disconnectAfter = false;
}
bool skipDetect = false;
if (arg_get_lit(ctx, 3)) {
skipDetect = true;
}
bool decodeTLV = false;
if (arg_get_lit(ctx, 4)) {
decodeTLV = true;
}
uint8_t data[PM3_CMD_DATA_SIZE] = {0}; uint8_t data[PM3_CMD_DATA_SIZE] = {0};
int datalen = 0; int datalen = 0;