chg: hexlen is half size..

This commit is contained in:
Chris 2018-07-04 14:33:59 +02:00
parent e536cb082f
commit f2ad37aa00

View file

@ -477,6 +477,7 @@ int CmdAnalyseA(const char *Cmd){
switch (tolower(param_getchar(Cmd, cmdp))) {
case 'd':
param_gethex_ex(Cmd, cmdp+1, data, &hexlen);
hexlen >>= 1;
if ( hexlen != sizeof(data) ) {
PrintAndLogEx(WARNING, "Read %d bytes of %u", hexlen, sizeof(data) );
}
@ -500,6 +501,14 @@ int CmdAnalyseA(const char *Cmd){
memcpy(c.d.asBytes, data, hexlen );
clearCommandBuffer();
SendCommand(&c);
// reading response from smart card
UsbCommand resp;
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
PrintAndLogEx(WARNING, "smart card response failed");
return 1;
}
PrintAndLogEx(SUCCESS,"resp: %s", sprint_hex(resp.d.asBytes, resp.arg[0]));
return 0;
PrintAndLogEx(NORMAL, "-- " _BLUE_(its my message) "\n");