Update to 'hf.field.timeout_sec'

This commit is contained in:
kormax committed 2026-03-31 17:03:23 +03:00
1 parent b443fc7723
commit 75a49716a9
5 files changed
+30 -32

No files matched your search

+6 -4
View File
@@ -846,11 +846,13 @@ bool OpenProxmark(pm3_device_t **dev, const char *port, bool wait_for_port, int
}
}
int SetHfFieldTimeout(uint32_t timeout_ms, bool quiet) {
int SetHfFieldTimeout(uint32_t timeout_sec, bool quiet) {
if (g_session.pm3_present == false) {
return PM3_ENOTTY;
}
uint32_t timeout_ms = timeout_sec * 1000U;
clearCommandBuffer();
SendCommandNG(CMD_SET_HF_FIELD_TIMEOUT, (uint8_t *)&timeout_ms, sizeof(timeout_ms));
@@ -944,10 +946,10 @@ int TestProxmark(pm3_device_t *dev) {
}
}
if (g_session.hf_field_timeout > 0) {
int timeout_res = SetHfFieldTimeout(g_session.hf_field_timeout, true);
if (g_session.hf_field_timeout_sec > 0) {
int timeout_res = SetHfFieldTimeout(g_session.hf_field_timeout_sec, true);
if (timeout_res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, "Failed to apply HF field timeout (" _YELLOW_("%u") " ms)", g_session.hf_field_timeout);
PrintAndLogEx(WARNING, "Failed to apply HF field timeout (" _YELLOW_("%u") " s)", g_session.hf_field_timeout_sec);
}
}
return PM3_SUCCESS;