Improve DEP info struct: add more info, and InJumpDEP now fill fully this struct.
This commit is contained in:
parent
1d0c7fe68e
commit
1e9c390dfa
6 changed files with 58 additions and 15 deletions
|
|
@ -59,10 +59,12 @@ nfc_emulate_uid_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
|||
libnfcutils.la
|
||||
|
||||
nfcip_target_SOURCES = nfcip-target.c
|
||||
nfcip_target_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||
nfcip_target_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
||||
libnfcutils.la
|
||||
|
||||
nfcip_initiator_SOURCES = nfcip-initiator.c
|
||||
nfcip_initiator_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||
nfcip_initiator_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
||||
libnfcutils.la
|
||||
|
||||
pn53x_diagnose_SOURCES = pn53x-diagnose.c
|
||||
pn53x_diagnose_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
||||
|
|
|
|||
|
|
@ -197,6 +197,21 @@ print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
print_nfc_dep_info (const nfc_dep_info_t ndi)
|
||||
{
|
||||
printf (" NFCID3: ");
|
||||
print_hex (ndi.abtNFCID3, 10);
|
||||
printf (" BS: %02x\n", ndi.btBS);
|
||||
printf (" BR: %02x\n", ndi.btBR);
|
||||
printf (" TO: %02x\n", ndi.btTO);
|
||||
printf (" PP: %02x\n", ndi.btPP);
|
||||
if (ndi.szGB) {
|
||||
printf ("General Bytes: ");
|
||||
print_hex (ndi.abtGB, ndi.szGB);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tries to parse arguments to find device descriptions.
|
||||
* @return Returns the list of found device descriptions.
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ void print_nfc_iso14443a_info (const nfc_iso14443a_info_t nai);
|
|||
void print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi);
|
||||
void print_nfc_felica_info (const nfc_felica_info_t nfi);
|
||||
void print_nfc_jewel_info (const nfc_jewel_info_t nji);
|
||||
void print_nfc_dep_info (const nfc_dep_info_t ndi);
|
||||
|
||||
nfc_device_desc_t *parse_device_desc (int argc, const char *argv[], size_t * szFound);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,18 +29,21 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
#include "nfc-utils.h"
|
||||
|
||||
#define MAX_FRAME_LEN 264
|
||||
|
||||
int
|
||||
main (int argc, const char *argv[])
|
||||
{
|
||||
nfc_device_t *pnd;
|
||||
nfc_target_info_t ti;
|
||||
nfc_target_info_t nti;
|
||||
byte_t abtRx[MAX_FRAME_LEN];
|
||||
size_t szRx;
|
||||
byte_t send[] = "Hello World!";
|
||||
byte_t abtTx[] = "Hello World!";
|
||||
|
||||
if (argc > 1) {
|
||||
printf ("Usage: %s\n", argv[0]);
|
||||
|
|
@ -58,13 +61,15 @@ main (int argc, const char *argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(!nfc_initiator_select_dep_target (pnd, NM_PASSIVE_DEP, NULL, 0, NULL, 0, NULL, 0, &ti)) {
|
||||
if(!nfc_initiator_select_dep_target (pnd, NM_PASSIVE_DEP, NULL, 0, NULL, 0, NULL, 0, &nti)) {
|
||||
nfc_perror(pnd, "nfc_initiator_select_dep_target");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf( "This D.E.P. target have been found:\n" );
|
||||
print_nfc_dep_info (nti.ndi);
|
||||
|
||||
printf ("Sending: %s\n", send);
|
||||
if (!nfc_initiator_transceive_bytes (pnd, send, strlen ((char *) send), abtRx, &szRx)) {
|
||||
printf ("Sending: %s\n", abtTx);
|
||||
if (!nfc_initiator_transceive_bytes (pnd, abtTx, sizeof(abtTx), abtRx, &szRx)) {
|
||||
nfc_perror(pnd, "nfc_initiator_transceive_bytes");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue