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:
Romuald Conty
2010-10-04 12:46:03 +00:00
parent d2d15afa3b
commit 5233fceda7
11 changed files with 272 additions and 38 deletions

View File

@@ -59,7 +59,17 @@ main (int argc, const char *argv[])
errx (1, "usage: %s", argv[0]);
}
if (!pnd || !nfc_target_init (pnd, NTM_DEP, abtRecv, &szRecvBits)) {
// 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 (!pnd || !nfc_target_init (pnd, NTM_DEP, nt, abtRecv, &szRecvBits)) {
printf ("unable to connect or initialize\n");
return 1;
}