Sync w/ libnfc-1.5.1.
This commit is contained in:
parent
a52505844d
commit
0bf933b95f
@ -59,7 +59,7 @@ fi
|
|||||||
AC_SUBST([DEBUG_CFLAGS])
|
AC_SUBST([DEBUG_CFLAGS])
|
||||||
|
|
||||||
# Checks for pkg-config modules.
|
# Checks for pkg-config modules.
|
||||||
LIBNFC_REQUIRED_VERSION=1.4.0
|
LIBNFC_REQUIRED_VERSION=1.5.1
|
||||||
PKG_CHECK_MODULES([libnfc], [libnfc >= $LIBNFC_REQUIRED_VERSION], [], [AC_MSG_ERROR([libnfc >= $LIBNFC_REQUIRED_VERSION is mandatory.])])
|
PKG_CHECK_MODULES([libnfc], [libnfc >= $LIBNFC_REQUIRED_VERSION], [], [AC_MSG_ERROR([libnfc >= $LIBNFC_REQUIRED_VERSION is mandatory.])])
|
||||||
|
|
||||||
AC_SUBST(libnfc_LIBS)
|
AC_SUBST(libnfc_LIBS)
|
||||||
|
|||||||
@ -81,7 +81,7 @@ mifare_ultralight_identification(const nfc_iso14443a_info_t nai)
|
|||||||
};
|
};
|
||||||
if(nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL) ) {
|
if(nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL) ) {
|
||||||
nfc_configure (pnd, NDO_EASY_FRAMING, false);
|
nfc_configure (pnd, NDO_EASY_FRAMING, false);
|
||||||
if (nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, &szRxLen)) {
|
if (nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, &szRxLen, NULL)) {
|
||||||
// AUTH step1 command success, so it's a Ultralight C
|
// AUTH step1 command success, so it's a Ultralight C
|
||||||
nfc_configure (pnd, NDO_EASY_FRAMING, true);
|
nfc_configure (pnd, NDO_EASY_FRAMING, true);
|
||||||
nfc_initiator_deselect_target(pnd);
|
nfc_initiator_deselect_target(pnd);
|
||||||
@ -118,12 +118,12 @@ mifare_desfire_identification(const nfc_iso14443a_info_t nai)
|
|||||||
.nbr = NBR_106
|
.nbr = NBR_106
|
||||||
};
|
};
|
||||||
if(nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL) ) {
|
if(nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL) ) {
|
||||||
if (nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen)) {
|
if (nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, NULL)) {
|
||||||
// MIFARE DESFire GetVersion command success, decoding...
|
// MIFARE DESFire GetVersion command success, decoding...
|
||||||
if( szRxLen == 8 ) { // GetVersion should reply 8 bytes
|
if( szRxLen == 8 ) { // GetVersion should reply 8 bytes
|
||||||
memcpy( abtDESFireVersion, abtRx + 1, 7 );
|
memcpy( abtDESFireVersion, abtRx + 1, 7 );
|
||||||
abtCmd[0] = 0xAF; // ask for GetVersion next bytes
|
abtCmd[0] = 0xAF; // ask for GetVersion next bytes
|
||||||
if (nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen)) {
|
if (nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, NULL)) {
|
||||||
if( szRxLen == 8 ) { // GetVersion should reply 8 bytes
|
if( szRxLen == 8 ) { // GetVersion should reply 8 bytes
|
||||||
memcpy( abtDESFireVersion + 7, abtRx + 1, 7 );
|
memcpy( abtDESFireVersion + 7, abtRx + 1, 7 );
|
||||||
res = malloc(16); // We can alloc res: we will be able to provide information
|
res = malloc(16); // We can alloc res: we will be able to provide information
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user