mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
add timeout and some debug messages
This commit is contained in:
parent
7c2379ac9f
commit
1a620c5563
2 changed files with 7 additions and 2 deletions
|
@ -224,6 +224,7 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||||
bool exit_loop = false;
|
bool exit_loop = false;
|
||||||
bool field_on = false;
|
bool field_on = false;
|
||||||
|
|
||||||
|
uint32_t startTime = GetTickCount();
|
||||||
while (exit_loop == false) {
|
while (exit_loop == false) {
|
||||||
|
|
||||||
button_pressed = BUTTON_PRESS();
|
button_pressed = BUTTON_PRESS();
|
||||||
|
@ -233,6 +234,9 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||||
|
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
|
if (startTime > 0 && startTime + timeout < GetTickCount())
|
||||||
|
break;
|
||||||
|
|
||||||
// in mV
|
// in mV
|
||||||
int vHf = (MAX_ADC_HF_VOLTAGE * SumAdc(ADC_CHAN_HF, 32)) >> 15;
|
int vHf = (MAX_ADC_HF_VOLTAGE * SumAdc(ADC_CHAN_HF, 32)) >> 15;
|
||||||
if (vHf > MF_MINFIELDV) {
|
if (vHf > MF_MINFIELDV) {
|
||||||
|
@ -261,7 +265,7 @@ int HfSimulateTkm(uint8_t *uid, uint8_t modulation, uint32_t timeout) {
|
||||||
switch_off();
|
switch_off();
|
||||||
|
|
||||||
if (button_pressed)
|
if (button_pressed)
|
||||||
DbpString("button pressed");
|
DbpString("Exit by press button");
|
||||||
|
|
||||||
reply_ng(CMD_HF_TEXKOM_SIMULATE, PM3_SUCCESS, NULL, 0);
|
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));
|
SendCommandNG(CMD_HF_TEXKOM_SIMULATE, (uint8_t*)&payload, sizeof(payload));
|
||||||
|
|
||||||
if (payload.timeout > 0 && payload.timeout < 2800) {
|
if (payload.timeout > 0 && payload.timeout < 2800) {
|
||||||
|
PrintAndLogEx(INFO, "simulate command started");
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
if (WaitForResponseTimeout(CMD_HF_TEXKOM_SIMULATE, &resp, 3000) == false) {
|
if (WaitForResponseTimeout(CMD_HF_TEXKOM_SIMULATE, &resp, 3000) == false) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
@ -636,7 +637,7 @@ static int CmdHFTexkomSim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
PrintAndLogEx(INFO, "simulate command execution done");
|
PrintAndLogEx(INFO, "simulate command execution done");
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(INFO, "simulate command started");
|
PrintAndLogEx(INFO, "simulate command started...");
|
||||||
}
|
}
|
||||||
|
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue