Skip to content

Commit

Permalink
R2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeslin committed Mar 1, 2016
1 parent 3f1e559 commit fbad2fb
Show file tree
Hide file tree
Showing 34 changed files with 1,817 additions and 31 deletions.
20 changes: 20 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ lib_LTLIBRARIES = libnfc_nci_linux.la

sbin_PROGRAMS = nfcDemoApp
nfcDemoApp_DEPENDENCIES = libnfc_nci_linux.la

LDFLAGS = -Bstatic

if LLCP1_3
LDFLAGS += -L$(openssldir)/lib -lcrypto -lssl
endif

nfcDemoApp_FLAGS = -I$(srcdir)/demoapp -I$(srcdir)/src/include

AM_CPPFLAGS = \
Expand All @@ -10,6 +17,11 @@ AM_CPPFLAGS = \
$(libnfc_nci_linux_la_FLAGS) \
$(nfcDemoApp_FLAGS)

if LLCP1_3
AM_CPPFLAGS += \
-I$(openssldir)/include
endif

configdir = ${sysconfdir}

if PN7120
Expand Down Expand Up @@ -68,6 +80,7 @@ LIBNFC_NCI_SOURCE := \
src/libnfc-nci/gki/common/gki_time.c \
src/libnfc-nci/gki/common/gki_buffer.c \
src/libnfc-nci/gki/ulinux/gki_ulinux.c \
src/libnfc-nci/nfc/cipher/cipher.c \
src/libnfc-nci/nfc/llcp/llcp_sdp.c \
src/libnfc-nci/nfc/llcp/llcp_link.c \
src/libnfc-nci/nfc/llcp/llcp_api.c \
Expand Down Expand Up @@ -150,6 +163,7 @@ SERVICE_SOURCE := \
src/service/interface/nativeNfcHandover.cpp \
src/service/interface/nativeNfcManager.cpp \
src/service/interface/nativeNfcSnep.cpp \
src/service/interface/nativeNfcLlcp.cpp \
src/service/interface/RoutingManager.cpp \
src/service/extns/src/mifare/phFriNfc_SmtCrdFmt.c \
src/service/extns/src/mifare/phNxpExtns_MifareStd.c \
Expand Down Expand Up @@ -190,6 +204,12 @@ libnfc_nci_linux_la_FLAGS += -DNXP_HW_SELF_TEST
libnfc_nci_linux_la_FLAGS += -DDEBUG
libnfc_nci_linux_la_FLAGS += -DNXP_NFC_NATIVE_ENABLE_HCE=TRUE

if LLCP1_3
libnfc_nci_linux_la_FLAGS += -DNFC_NXP_LLCP_SECURED_P2P=TRUE
else
libnfc_nci_linux_la_FLAGS += -DNFC_NXP_LLCP_SECURED_P2P=FALSE
endif

if PN7120
libnfc_nci_linux_la_FLAGS += -DNFC_NXP_CHIP_TYPE=PN547C2 -DNXP_CHIP_NAME=\"pn7120\"
libnfc_nci_linux_la_FLAGS += -DPH_NCI_NXP_HAL_ENABLE_FW_DOWNLOAD=FALSE
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Further details about the stack [here](https://github.com/NXPNFCLinux/linux_libn

Release version
---------------
R1.0 is the official Linux libnfc-nci stack
R2.0 includes LLCP1.3 support and some bug fixes (refer to the [documentation](https://github.com/NXPNFCLinux/linux_libnfc-nci/blob/master/doc/AN11697%20-%20PN7120%20Linux%20Software%20Stack%20Integration%20Guidelines.pdf) for more details).
R1.0 is the first official release of Linux libnfc-nci stack

Possible problems, known errors and restrictions of R1.0:
Possible problems, known errors and restrictions of R2.0:
---------------------------------------------------------
none
LLCP1.3 support requires OpenSSL Cryptography and SSL/TLS Toolkit (version 1.0.1j or later)
5 changes: 5 additions & 0 deletions conf/PN7120/libnfc-nxp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# NXPLOG_FWDNLD_LOGLEVEL - Configuration for enabling logging of FW download functionality
# NXPLOG_TML_LOGLEVEL - Configuration for enabling logging of TML
# NXPLOG_NCIHAL_LOGLEVEL - Configuration for enabling logging of HAL
NXPLOG_EXTNS_LOGLEVEL=0x00
NXPLOG_NCIX_LOGLEVEL=0x00
NXPLOG_NCIR_LOGLEVEL=0x00
NXPLOG_FWDNLD_LOGLEVEL=0x00
Expand Down Expand Up @@ -53,6 +54,10 @@ NXP_ACT_PROP_EXTN={2F, 02, 00}
# For more details refer to the POLL_PROFILE_SEL_ CFG parameter definition from NFC Controller User Manual
NXP_NFC_PROFILE_EXTN={20, 02, 05, 01, A0, 44, 01, 00}

###############################################################################
# Standby enable settings. (disable=2F 00 01 00, enable=2F 00 01 01)
NXP_CORE_STANDBY={2F, 00, 01, 01}

###############################################################################
# NXP Proprietary core configuration extensions
# For more details refer to the NFC Controller User Manual
Expand Down
24 changes: 23 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
_AC_FUNC_MALLOC_IF


AC_CHECK_FUNCS([gettimeofday memmove memset strerror strstr])
AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_FUNCS([select])
Expand All @@ -55,6 +54,16 @@ AC_ARG_ENABLE([pn7120],
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pn7120]) ;;
esac],[pn7120=false])

AC_ARG_VAR(openssldir, help-string)

AC_ARG_ENABLE([llcp1_3],
[ --enable-llcp1_3 enable LLCP1.3 (secured P2P)],
[case "${enableval}" in
yes) llcp1_3=true ;;
no) llcp1_3=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-llcp1_3]) ;;
esac],[llcp1_3=false])

AM_CONDITIONAL([CHIP_SEL_NOK], [
COUNT=0
if [ "$pn7120" = "true" ]; then
Expand All @@ -64,13 +73,26 @@ if [test "$COUNT" -gt 1]; then
AC_MSG_ERROR(Can not enable multiple chip type)
fi])

AM_CONDITIONAL([LLCP1_3_ENABLED], [if [$llcp1_3]; then
AC_MSG_NOTICE([LLCP1.3 support is enabled (secure P2P)])
AM_CONDITIONAL([OPENSSLDIR_SET], [if ["${ac_cv_env_openssldir_set}" = "set"]; then
AC_MSG_NOTICE([openssldir path set])
else
AC_MSG_ERROR(path to openssldir not set (required when LLCP1.3 support is enabled))
fi])
else
AC_MSG_NOTICE([LLCP1.3 support is disabled (no secure P2P)])
fi])

AM_CONDITIONAL([CHIP_SEL_ONE], [if [$pn7120]; then
AC_MSG_NOTICE([Selected chip type is PN7120])
else
AC_MSG_NOTICE([Selected chip type is PN7120])
pn7120=true
fi])

AM_CONDITIONAL([LLCP1_3], [test x$llcp1_3 = xtrue])

AM_CONDITIONAL([PN7120], [test x$pn7120 = xtrue])

AC_OUTPUT
Binary file not shown.
26 changes: 26 additions & 0 deletions doc/Linux_NFC_API_Guide/search/all_10.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_10.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
16 changes: 16 additions & 0 deletions doc/Linux_NFC_API_Guide/search/all_10.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions doc/Linux_NFC_API_Guide/search/defines_3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="defines_3.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
15 changes: 15 additions & 0 deletions doc/Linux_NFC_API_Guide/search/defines_3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions doc/Linux_NFC_API_Guide/search/typedefs_1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="typedefs_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions doc/Linux_NFC_API_Guide/search/typedefs_1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var searchData=
[
['tnfc_5fprotocol',['tNFC_PROTOCOL',['../linux__nfc__api_8h.html#a5bbdb860d0cd45c3077e27bbcf0abc5f',1,'linux_nfc_api.h']]]
];
65 changes: 64 additions & 1 deletion src/include/linux_nfc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,26 @@ typedef struct {
void (*onMessageReceived)(unsigned char *message, unsigned int length);
}nfcSnepServerCallback_t;

/**
* \brief NFC LLCP connectionless server callback function structure definition.
*/
typedef struct {
/**
* \brief NFC Peer Device callback function when device is detected.
*/
void (*onDeviceArrival) (void);

/**
* \brief NFC Peer Device callback function when device is removed.
*/
void (*onDeviceDeparture) (void);

/**
* \brief NFC Peer Device callback function when NDEF message is received from peer device.
*/
void (*onMessageReceived)(void);
}nfcllcpConnlessServerCallback_t;

/**
* \brief NFC SNEP client callback function structure definition.
*/
Expand All @@ -381,7 +401,7 @@ typedef struct {
* \brief NFC Peer Device callback function when device is removed.
*/
void (*onDeviceDeparture) (void);
}nfcSnepClientCallback_t;
}nfcSnepClientCallback_t, nfcllcpConnlessClientCallback_t;

/**
* \brief Host card emulation callback function structure definition.
Expand Down Expand Up @@ -702,6 +722,49 @@ extern int nfcHo_sendSelectRecord(unsigned char *message, unsigned int length);
*/
extern int nfcHo_sendSelectError(unsigned int reason, unsigned int data);

/**
* \brief Register a callback functions for LLCP client.
* \param client_callback: LLCP client callback functions.
* \return 0 if success
*/
extern int nfcLlcp_ConnLessRegisterClientCallback(nfcSnepClientCallback_t *client_callback);

/**
* \brief Deregister a callback functions for LLCP client.
* \return None
*/
extern void nfcLlcp_ConnLessDeregisterClientCallback();

/**
* \brief Start a LLCP Connection Less server to receive LLCP message.
* \param server_callback: LLCP connectionless server callback functions.
* \return 0 if success
*/
extern int nfcLlcp_ConnLessStartServer(nfcllcpConnlessServerCallback_t *server_callback);

/**
* \brief Stop LLCP server.
* \return None
*/
extern void nfcLlcp_ConnLessStopServer();

/**
* \brief Send a LLCP message to remote LLCP server.
* \param msg: LLCP message.
* \param length: LLCP message length.
* \return 0 if success, otherwise failed.
*/
extern int nfcLlcp_ConnLessSendMessage(unsigned char* msg, unsigned int length);

/**
* \brief Receive a LLCP message from remote LLCP server.
* \param msg: LLCP message.
* \param length: LLCP message length.
* \return 0 if success, otherwise failed.
*/
extern int nfcLlcp_ConnLessReceiveMessage(unsigned char* msg, unsigned int *length);


#ifdef __cplusplus
}
#endif
Expand Down
14 changes: 13 additions & 1 deletion src/libnfc-nci/gki/ulinux/gki_ulinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ static pthread_cond_t gki_timer_update_cond;
static pthread_t timer_thread_id = 0;
#endif


#if (NFC_NXP_NOT_OPEN_INCLUDED == TRUE)
UINT8 gki_buf_init_done = FALSE;
#endif
/* For Android */

#ifndef GKI_SHUTDOWN_EVT
Expand Down Expand Up @@ -147,9 +149,19 @@ void GKI_init(void)
pthread_mutexattr_t attr;
tGKI_OS *p_os;

#if (NFC_NXP_NOT_OPEN_INCLUDED == TRUE)
/* Added to avoid re-initialization of memory pool (memory leak) */
if(!gki_buf_init_done)
{
memset (&gki_cb, 0, sizeof (gki_cb));
gki_buffer_init();
gki_buf_init_done = TRUE;
}
#else
memset (&gki_cb, 0, sizeof (gki_cb));

gki_buffer_init();
#endif
gki_timers_init();
gki_cb.com.OSTicks = (UINT32) times(0);

Expand Down
3 changes: 3 additions & 0 deletions src/libnfc-nci/include/nci_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ int GetNumValue(const char* name, void* p_value, unsigned long len);
#define NAME_NFA_DM_DISC_NTF_TIMEOUT "NFA_DM_DISC_NTF_TIMEOUT"
#define NAME_NXP_FWD_FUNCTIONALITY_ENABLE "NXP_FWD_FUNCTIONALITY_ENABLE"
#endif
#if (NFC_NXP_LLCP_SECURED_P2P == TRUE)
#define NAME_LLCP_SECURED_P2P_ENABLE "LLCP_SECURED_P2P_ENABLE"
#endif
#if(NFC_NXP_CHIP_TYPE != PN547C2)
#define NAME_NXP_PRFD_TECH_SE "NXP_PRFD_TECH_SE"
#endif
Expand Down
Loading

0 comments on commit fbad2fb

Please sign in to comment.