Improve the target emulation functions (ATM, only ISO14443A), add an example (nfc-emulate-tag), update examples to use the new API.
This commit is contained in:
parent
d2d15afa3b
commit
5233fceda7
11 changed files with 272 additions and 38 deletions
|
|
@ -125,7 +125,18 @@ main (int argc, char *argv[])
|
|||
printf ("[+] Try to break out the auto-emulation, this requires a second reader!\n");
|
||||
printf ("[+] To do this, please send any command after the anti-collision\n");
|
||||
printf ("[+] For example, send a RATS command or use the \"nfc-anticol\" tool\n");
|
||||
if (!nfc_target_init (pndTag, NTM_PASSIVE, abtReaderRx, &szReaderRxBits)) {
|
||||
|
||||
// Note: We have to build a "fake" nfc_target_t in order to do exactly the same that was done before the new nfc_target_init() was introduced.
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_GENERIC_PASSIVE_106,
|
||||
.nti.nai.abtAtqa = "\x04\x00",
|
||||
.nti.nai.abtUid = "\xde\xad\xbe\xaf\x62",
|
||||
.nti.nai.btSak = 0x20,
|
||||
.nti.nai.szUidLen = 5,
|
||||
.nti.nai.szAtsLen = 0,
|
||||
};
|
||||
|
||||
if (!nfc_target_init (pndTag, NTM_PASSIVE, nt, abtReaderRx, &szReaderRxBits)) {
|
||||
ERR ("%s", "Initialization of NFC emulator failed");
|
||||
nfc_disconnect (pndTag);
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue