chg: "lf sim" - now only fills until bigbuffer is full

This commit is contained in:
iceman1001 2020-04-29 20:33:29 +02:00
parent 31ccc7d7ca
commit fa44eee82c

View file

@ -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");