mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
add timeout and some debug messages
This commit is contained in:
+5
-1
@@ -224,6 +224,7 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||
bool exit_loop = false;
|
||||
bool field_on = false;
|
||||
|
||||
uint32_t startTime = GetTickCount();
|
||||
while (exit_loop == false) {
|
||||
|
||||
button_pressed = BUTTON_PRESS();
|
||||
@@ -233,6 +234,9 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||
|
||||
WDT_HIT();
|
||||
|
||||
if (startTime > 0 && startTime + timeout < GetTickCount())
|
||||
break;
|
||||
|
||||
// in mV
|
||||
int vHf = (MAX_ADC_HF_VOLTAGE * SumAdc(ADC_CHAN_HF, 32)) >> 15;
|
||||
if (vHf > MF_MINFIELDV) {
|
||||
@@ -261,7 +265,7 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||
switch_off();
|
||||
|
||||
if (button_pressed)
|
||||
DbpString("button pressed");
|
||||
DbpString("Exit by press button");
|
||||
|
||||
reply_ng(CMD_HF_TEXKOM_SIMULATE, PM3_SUCCESS, NULL, 0);
|
||||
|
||||
|
||||
@@ -627,6 +627,7 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||
SendCommandNG(CMD_HF_TEXKOM_SIMULATE, (uint8_t*)&payload, sizeof(payload));
|
||||
|
||||
if (payload.timeout > 0 && payload.timeout < 2800) {
|
||||
PrintAndLogEx(INFO, "simulate command started");
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_TEXKOM_SIMULATE, &resp, 3000) == false) {
|
||||
if (verbose) {
|
||||
@@ -636,7 +637,7 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||
}
|
||||
PrintAndLogEx(INFO, "simulate command execution done");
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "simulate command started");
|
||||
PrintAndLogEx(INFO, "simulate command started...");
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user