From 0378d915955bbc4d234afb9b74ef6a59ef780b6d Mon Sep 17 00:00:00 2001 From: Antiklesys Date: Thu, 12 Jun 2025 19:42:56 +0800 Subject: [PATCH] Minor iclass sam comms tweaks 1- Removed timeout on client side to allow the sam to be slow in responding 2- Increased SIM_WAIT_DELAY to allow for bigger sam responses --- armsrc/i2c.h | 2 +- armsrc/sam_common.c | 4 ++-- client/src/cmdhficlass.c | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/armsrc/i2c.h b/armsrc/i2c.h index 3b45c6d7d..b45832acd 100644 --- a/armsrc/i2c.h +++ b/armsrc/i2c.h @@ -36,7 +36,7 @@ // 8051 speaks with smart card. // 1000*50*3.07 = 153.5ms // 1 byte transfer == 1ms with max frame being 256 bytes -#define SIM_WAIT_DELAY 88000 // about 270ms delay // 109773 -- about 337.7ms delay +#define SIM_WAIT_DELAY 150000 // about 270ms delay // 109773 -- about 337.7ms delay void I2C_recovery(void); diff --git a/armsrc/sam_common.c b/armsrc/sam_common.c index 38c2f3c1f..310c2f826 100644 --- a/armsrc/sam_common.c +++ b/armsrc/sam_common.c @@ -279,7 +279,7 @@ int sam_get_version(bool info) { if (g_dbglevel >= DBG_INFO || info) { DbpString(_BLUE_("-- SAM Information --")); Dbprintf(_YELLOW_("Firmware version: ")"%X.%X", sam_version_an[2], sam_version_an[3]); - Dbprintf(_YELLOW_("Firmware ID : ")); + Dbprintf(_YELLOW_("Firmware ID: ")); Dbhexdump(sam_build_an[1], sam_build_an + 2, false); } goto out; @@ -348,7 +348,7 @@ int sam_get_serial_number(void) { goto error; } - Dbprintf(_YELLOW_("Sam Serial Number: ")); + Dbprintf(_YELLOW_("Serial Number: ")); Dbhexdump(sam_response_an[1],sam_serial_an, false); goto out; diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index a21d9c3ee..c8054cc2c 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -5961,10 +5961,7 @@ static int CmdHFiClassSAM(const char *Cmd) { clearCommandBuffer(); SendCommandNG(CMD_HF_SAM_PICOPASS, data, cmdlen + 1); PacketResponseNG resp; - if (WaitForResponseTimeout(CMD_HF_SAM_PICOPASS, &resp, 4000) == false) { - PrintAndLogEx(WARNING, "SAM timeout"); - return PM3_ETIMEOUT; - } + WaitForResponse(CMD_HF_SAM_PICOPASS, &resp); switch (resp.status) { case PM3_SUCCESS: