From fa44eee82c0368508fbbcdc9df1dadd930aff852 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 29 Apr 2020 20:33:29 +0200 Subject: [PATCH] chg: "lf sim" - now only fills until bigbuffer is full --- client/src/cmdlf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index 1443a5d6a..9324062a1 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -702,6 +702,8 @@ int CmdLFSim(const char *Cmd) { PrintAndLogEx(DEBUG, "DEBUG: Uploading %zu bytes", GraphTraceLen); + PacketResponseNG resp; + struct pupload { uint8_t flag; uint16_t offset; @@ -726,9 +728,12 @@ int CmdLFSim(const char *Cmd) { for (uint16_t j = 0; j < len; j++) payload_up.data[j] = GraphBuffer[i + j]; - SendCommandNG(CMD_LF_UPLOAD_SIM_SAMPLES, (uint8_t *)&payload_up, sizeof(struct pupload)); - WaitForResponse(CMD_LF_UPLOAD_SIM_SAMPLES, NULL); + WaitForResponse(CMD_LF_UPLOAD_SIM_SAMPLES, &resp); + if (resp.status != PM3_SUCCESS) { + PrintAndLogEx(INFO, "Bigbuf is full."); + break; + } printf("."); fflush(stdout); payload_up.flag = 0; @@ -750,7 +755,6 @@ int CmdLFSim(const char *Cmd) { clearCommandBuffer(); SendCommandNG(CMD_LF_SIMULATE, (uint8_t *)&payload, sizeof(payload)); - PacketResponseNG resp; WaitForResponse(CMD_LF_SIMULATE, &resp); PrintAndLogEx(INFO, "Done");