using libnfc 1.5.1
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@657 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -21,9 +21,9 @@ PKG_CHECK_EXISTS([libpcsclite],
|
|||||||
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
|
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
|
||||||
[AC_MSG_WARN([libpcsclite not found by pkg-config])])
|
[AC_MSG_WARN([libpcsclite not found by pkg-config])])
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
PKG_CHECK_EXISTS([libnfc >= 1.3.9],
|
PKG_CHECK_EXISTS([libnfc >= 1.5.1],
|
||||||
[PKG_CHECK_MODULES([LIBNFC], [libnfc >= 1.3.9])],
|
[PKG_CHECK_MODULES([LIBNFC], [libnfc >= 1.5.1])],
|
||||||
[AC_MSG_WARN([libnfc >= 1.3.9 not found by pkg-config])])
|
[AC_MSG_WARN([libnfc >= 1.5.1 not found by pkg-config])])
|
||||||
|
|
||||||
|
|
||||||
saved_CPPFLAGS="$CPPFLAGS"
|
saved_CPPFLAGS="$CPPFLAGS"
|
||||||
@@ -37,10 +37,10 @@ AC_MSG_CHECKING([for SCardEstablishContext])
|
|||||||
AC_TRY_LINK_FUNC(SCardEstablishContext, [ AC_MSG_RESULT([yes]) ],
|
AC_TRY_LINK_FUNC(SCardEstablishContext, [ AC_MSG_RESULT([yes]) ],
|
||||||
[ AC_MSG_ERROR([libpcsclite not found, use ./configure PCSC_LIBS=...]) ])
|
[ AC_MSG_ERROR([libpcsclite not found, use ./configure PCSC_LIBS=...]) ])
|
||||||
AC_CHECK_HEADERS(nfc/nfc.h,,
|
AC_CHECK_HEADERS(nfc/nfc.h,,
|
||||||
[ AC_MSG_ERROR([nfc/nfc.h not found, install libnfc >= 1.3.9 or use ./configure LIBNFC_CFLAGS=...]) ])
|
[ AC_MSG_ERROR([nfc/nfc.h not found, install libnfc >= 5.1.9 or use ./configure LIBNFC_CFLAGS=...]) ])
|
||||||
AC_MSG_CHECKING([for nfc_initiator_select_passive_target])
|
AC_MSG_CHECKING([for nfc_initiator_select_passive_target])
|
||||||
AC_TRY_LINK_FUNC(nfc_initiator_select_passive_target, [ AC_MSG_RESULT([yes]) ],
|
AC_TRY_LINK_FUNC(nfc_initiator_select_passive_target, [ AC_MSG_RESULT([yes]) ],
|
||||||
[ AC_MSG_ERROR([libnfc >= 1.3.9 not found, use ./configure LIBNFC_LIBS=...]) ])
|
[ AC_MSG_ERROR([libnfc >= 1.5.1 not found, use ./configure LIBNFC_LIBS=...]) ])
|
||||||
CPPFLAGS="$saved_CPPFLAGS"
|
CPPFLAGS="$saved_CPPFLAGS"
|
||||||
LIBS="$saved_LIBS"
|
LIBS="$saved_LIBS"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2010 Frank Morgner
|
* Copyright (C) 2011 Frank Morgner
|
||||||
*
|
*
|
||||||
* This file is part of pcsc-relay.
|
* This file is part of pcsc-relay.
|
||||||
*
|
*
|
||||||
@@ -30,6 +30,12 @@ struct lnfc_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static struct timeval transmit_timeout = {
|
||||||
|
1, /* seconds */
|
||||||
|
0, /* microseconds */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static size_t get_historical_bytes(unsigned char *atr, size_t atrlen,
|
static size_t get_historical_bytes(unsigned char *atr, size_t atrlen,
|
||||||
unsigned char **hb)
|
unsigned char **hb)
|
||||||
{
|
{
|
||||||
@@ -181,7 +187,7 @@ static int lnfc_receive_capdu(driver_data_t *driver_data,
|
|||||||
|
|
||||||
|
|
||||||
// Receive external reader command through target
|
// Receive external reader command through target
|
||||||
if (!nfc_target_receive_bytes(data->pndTarget, data->abtCapdu, &data->szCapduLen)) {
|
if (!nfc_target_receive_bytes(data->pndTarget, data->abtCapdu, &data->szCapduLen, &transmit_timeout)) {
|
||||||
ERROR ("nfc_target_receive_bytes: %s\n", nfc_strerror(data->pndTarget));
|
ERROR ("nfc_target_receive_bytes: %s\n", nfc_strerror(data->pndTarget));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -209,7 +215,7 @@ static int lnfc_send_rapdu(driver_data_t *driver_data,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
if (!nfc_target_send_bytes(data->pndTarget, rapdu, len)) {
|
if (!nfc_target_send_bytes(data->pndTarget, rapdu, len, &transmit_timeout)) {
|
||||||
ERROR ("nfc_target_send_bytes: %s\n", nfc_strerror(data->pndTarget));
|
ERROR ("nfc_target_send_bytes: %s\n", nfc_strerror(data->pndTarget));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user