chg: lf t55xx write - now uses NG frames.

This commit is contained in:
iceman1001 2019-05-13 13:23:53 +02:00
commit d2a4ade2af
15 changed files with 159 additions and 73 deletions

View file

@ -130,9 +130,14 @@ static int CmdPrescoClone(const char *Cmd) {
conn.block_after_ACK = false;
}
clearCommandBuffer();
uint8_t data[] = {0};
SendCommandMIX(CMD_T55XX_WRITE_BLOCK, blocks[i], i, 0, data, sizeof(data));
if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)) {
t55xx_write_block_t ng;
ng.data = blocks[i];
ng.pwd = 0;
ng.blockno = i;
ng.flags = 0;
SendCommandNG(CMD_T55XX_WRITE_BLOCK, (uint8_t *)&ng, sizeof(ng));
if (!WaitForResponseTimeout(CMD_T55XX_WRITE_BLOCK, &resp, T55XX_WRITE_TIMEOUT)) {
PrintAndLogEx(WARNING, "Error occurred, device did not respond during write operation.");
return -1;
}