Fixed lxdebub setconfig syntax error for unsupported FW versions
diff --git a/halimpl/pn54x/hal/phNxpNciHal.c b/halimpl/pn54x/hal/phNxpNciHal.c
index 19106f0..063c0a9 100644
--- a/halimpl/pn54x/hal/phNxpNciHal.c
+++ b/halimpl/pn54x/hal/phNxpNciHal.c
@@ -117,7 +117,7 @@
static NFCSTATUS phNxpNciHal_set_Boot_Mode(uint8_t mode);
NFCSTATUS phNxpNciHal_check_clock_config(void);
NFCSTATUS phNxpNciHal_set_china_region_configs(void);
-static void phNxpNciHal_configLxDebug(void);
+static void phNxpNciHal_configNciParser(void);
static NFCSTATUS phNxpNciHalRFConfigCmdRecSequence();
static NFCSTATUS phNxpNciHal_CheckRFCmdRespStatus();
int check_config_parameter();
@@ -2206,7 +2206,7 @@
}
}
- phNxpNciHal_configLxDebug();
+ phNxpNciHal_configNciParser();
retry_core_init_cnt = 0;
@@ -3759,7 +3759,7 @@
**
** Returns void
*******************************************************************************/
-void phNxpNciHal_configLxDebug(void)
+void phNxpNciHal_configNciParser(void)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
unsigned long num = 0;
@@ -3808,19 +3808,24 @@
{
NXPLOG_NCIHAL_E("Set lxDebug config failed");
}
- else {
- // try initializing parser
- NXPLOG_NCIHAL_D("Try Init Parser gParserCreated:%d",gParserCreated);
- if(!gParserCreated && (cmd_lxdebug[7] != 0x00))
- gParserCreated = phNxpNciHal_initParser();
+ }
- if(gParserCreated) {
- NXPLOG_NCIHAL_D("Parser Initialized Successfully");
- phNxpNciHal_parsePacket(cmd_lxdebug,sizeof(cmd_lxdebug)/sizeof(cmd_lxdebug[0]));
- }
- else {
- NXPLOG_NCIHAL_E("Parser Library Not Available");
- }
+ // try initializing parser library
+ NXPLOG_NCIHAL_D("Try Init Parser gParserCreated:%d",gParserCreated);
+
+ if(!gParserCreated) {
+ gParserCreated = phNxpNciHal_initParser();
+ } else {
+ NXPLOG_NCIHAL_D("Parser Already Initialized");
+ }
+
+ if(gParserCreated) {
+ NXPLOG_NCIHAL_D("Parser Initialized Successfully");
+ if(isfound) {
+ NXPLOG_NCIHAL_D("Setting lxdebug levels in library");
+ phNxpNciHal_parsePacket(cmd_lxdebug,sizeof(cmd_lxdebug)/sizeof(cmd_lxdebug[0]));
}
+ } else {
+ NXPLOG_NCIHAL_E("Parser Library Not Available");
}
}
diff --git a/halimpl/pn54x/hal/phNxpNciHal_nciParser.c b/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
index dd47828..8df85be 100644
--- a/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
+++ b/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
@@ -21,25 +21,25 @@
#include "phNxpLog.h"
-typedef void* tNCI_PARSER_OBJECT;
+typedef void* tNCI_PARSER_INSTANCE;
+typedef void* tNCI_PARSER_LIB_HANDLE;
typedef struct {
- tNCI_PARSER_OBJECT pvHandle;
- tNCI_PARSER_FUNCTIONS sEntryFuncs;
+ tNCI_PARSER_INSTANCE pvInstance;
+ tNCI_PARSER_LIB_HANDLE pvHandle;
+ tNCI_PARSER_FUNCTIONS sEntryFuncs;
} sParserContext_t;
-sParserContext_t sParserContext;
+static sParserContext_t sParserContext;
unsigned char
phNxpNciHal_initParser() {
- char *error;
- void *lib_handle;
sParserContext_t *psContext = &sParserContext;
memset(&psContext->sEntryFuncs,0,sizeof(psContext->sEntryFuncs));
- psContext->pvHandle = NULL;
+ psContext->pvInstance = NULL;
psContext->sEntryFuncs.createParser = NULL;
psContext->sEntryFuncs.initParser = NULL;
psContext->sEntryFuncs.deinitParser = NULL;
@@ -49,53 +49,53 @@
NXPLOG_NCIHAL_D("%s: enter", __FUNCTION__);
- lib_handle = dlopen(NXP_NCI_PARSER_PATH, RTLD_NOW);
- if (!lib_handle)
+ psContext->pvHandle = dlopen(NXP_NCI_PARSER_PATH, RTLD_NOW);
+ if (!psContext->pvHandle)
{
NXPLOG_NCIHAL_E("%s: dlopen failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->sEntryFuncs.createParser = dlsym(lib_handle, "native_createParser");
+ psContext->sEntryFuncs.createParser = dlsym(psContext->pvHandle, "native_createParser");
if (psContext->sEntryFuncs.createParser == NULL)
{
NXPLOG_NCIHAL_E("%s: dlsym native_createParser failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->sEntryFuncs.destroyParser = dlsym(lib_handle, "native_destroyParser");
+ psContext->sEntryFuncs.destroyParser = dlsym(psContext->pvHandle, "native_destroyParser");
if (psContext->sEntryFuncs.destroyParser == NULL)
{
NXPLOG_NCIHAL_E("%s: dlsym native_destroyParser failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->sEntryFuncs.initParser = dlsym(lib_handle, "native_initParser");
+ psContext->sEntryFuncs.initParser = dlsym(psContext->pvHandle, "native_initParser");
if (psContext->sEntryFuncs.initParser == NULL)
{
NXPLOG_NCIHAL_E("%s: dlsym native_initParser failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->sEntryFuncs.deinitParser = dlsym(lib_handle, "native_deinitParser");
+ psContext->sEntryFuncs.deinitParser = dlsym(psContext->pvHandle, "native_deinitParser");
if (psContext->sEntryFuncs.deinitParser == NULL)
{
NXPLOG_NCIHAL_E("%s: dlsym native_deinitParser failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->sEntryFuncs.parsePacket = dlsym(lib_handle, "native_parseNciMsg");
+ psContext->sEntryFuncs.parsePacket = dlsym(psContext->pvHandle, "native_parseNciMsg");
if (psContext->sEntryFuncs.parsePacket == NULL)
{
NXPLOG_NCIHAL_E("%s: dlsym native_parseNciMsg failed !!!", __FUNCTION__);
return FALSE;
}
- psContext->pvHandle = (*(psContext->sEntryFuncs.createParser))();
+ psContext->pvInstance = (*(psContext->sEntryFuncs.createParser))();
- if(psContext->pvHandle != NULL)
+ if(psContext->pvInstance != NULL)
{
- (*(psContext->sEntryFuncs.initParser))(psContext->pvHandle);
+ (*(psContext->sEntryFuncs.initParser))(psContext->pvInstance);
}
else
{
@@ -121,9 +121,9 @@
return;
}
- if(psContext->pvHandle != NULL)
+ if(psContext->pvInstance != NULL)
{
- (*(psContext->sEntryFuncs.parsePacket))(psContext->pvHandle, pNciPkt, pktLen);
+ (*(psContext->sEntryFuncs.parsePacket))(psContext->pvInstance, pNciPkt, pktLen);
}
else
{
@@ -138,16 +138,21 @@
NXPLOG_NCIHAL_D("%s: enter", __FUNCTION__);
- if(psContext->pvHandle != NULL)
+ if(psContext->pvInstance != NULL)
{
- (*(psContext->sEntryFuncs.deinitParser))(psContext->pvHandle);
+ (*(psContext->sEntryFuncs.deinitParser))(psContext->pvInstance);
- (*(psContext->sEntryFuncs.destroyParser))(psContext->pvHandle);
+ (*(psContext->sEntryFuncs.destroyParser))(psContext->pvInstance);
}
else
{
NXPLOG_NCIHAL_E("Invalid Handle");
}
+ if(psContext->pvHandle != NULL)
+ {
+ dlclose(psContext->pvHandle);
+ }
+
NXPLOG_NCIHAL_D("%s: exit", __FUNCTION__);
}
diff --git a/halimpl/pn54x/libnfc-nxp-PN553_example.conf b/halimpl/pn54x/libnfc-nxp-PN553_example.conf
index b02b438..bb5079a 100644
--- a/halimpl/pn54x/libnfc-nxp-PN553_example.conf
+++ b/halimpl/pn54x/libnfc-nxp-PN553_example.conf
@@ -345,6 +345,18 @@
NXP_CN_TRANSIT_BLK_NUM_CHECK_ENABLE=0x01
###############################################################################
+#This config will enable different level of Rf transaction debugs based on the
+#following values provided. Decoded information will be printed in adb logcat
+#Debug Mode Levels
+#Disable Debug 0x00
+#L1 Debug 0x01
+#L2 Debug 0x02
+#L1 & L2 Debug 0x03
+#L1 & L2 & RSSI 0x04
+#L1 & L2 & Felica 0x05
+#NXP_CORE_PROP_SYSTEM_DEBUG=0x00
+
+###############################################################################
# Restrict routing to first matched rule only.
# Blacklist enable 0x01
# Blacklist disable 0x00
diff --git a/halimpl/pn54x/libnfc-nxp-PN80T_example.conf b/halimpl/pn54x/libnfc-nxp-PN80T_example.conf
index 51a6162..dfcbaf7 100644
--- a/halimpl/pn54x/libnfc-nxp-PN80T_example.conf
+++ b/halimpl/pn54x/libnfc-nxp-PN80T_example.conf
@@ -363,7 +363,7 @@
#L1 & L2 Debug 0x03
#L1 & L2 & RSSI 0x04
#L1 & L2 & Felica 0x05
-NXP_CORE_PROP_SYSTEM_DEBUG=0x00
+#NXP_CORE_PROP_SYSTEM_DEBUG=0x00
###############################################################################
# Wired mode resume timeout vaule in wired mode resume feature enable