mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
Add support for standard USB Smartcard Readers (#765)
* add PCSC interface (pcsc.c and pcsc.h) * new command 'sc select' to choose an USB Smartcard Reader * updated CI/.travis.yml accordingly * remove TCK CRC check in i2c.c It is done in PrintATR() anyway * Fix TCK CRC check in PrintATR() * Add PCSC reader support to 'sc info'
This commit is contained in:
parent
1511ea28a8
commit
a9104f7e31
14 changed files with 382 additions and 93 deletions
|
@ -20,7 +20,8 @@
|
|||
#include "cmdmain.h"
|
||||
#include "cmddata.h"
|
||||
|
||||
/* low-level hardware control */
|
||||
|
||||
static uint32_t hw_capabilities = 0;
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
|
@ -403,6 +404,10 @@ int CmdTune(const char *Cmd)
|
|||
return CmdTuneSamples(Cmd);
|
||||
}
|
||||
|
||||
bool PM3hasSmartcardSlot(void) {
|
||||
return (hw_capabilities & HAS_SMARTCARD_SLOT);
|
||||
}
|
||||
|
||||
int CmdVersion(const char *Cmd)
|
||||
{
|
||||
|
||||
|
@ -411,10 +416,11 @@ int CmdVersion(const char *Cmd)
|
|||
UsbCommand resp = {0, {0, 0, 0}};
|
||||
|
||||
SendCommand(&c);
|
||||
if (WaitForResponseTimeout(CMD_ACK,&resp,1000)) {
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
|
||||
PrintAndLog("Prox/RFID mark3 RFID instrument");
|
||||
PrintAndLog((char*)resp.d.asBytes);
|
||||
lookupChipID(resp.arg[0], resp.arg[1]);
|
||||
hw_capabilities = resp.arg[2];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue