Fixed mutiple times Init/Deinit of lxdebug library
diff --git a/halimpl/pn54x/hal/phNxpNciHal.c b/halimpl/pn54x/hal/phNxpNciHal.c
index 33ab94d..19106f0 100644
--- a/halimpl/pn54x/hal/phNxpNciHal.c
+++ b/halimpl/pn54x/hal/phNxpNciHal.c
@@ -503,7 +503,6 @@
uint8_t cmd_reset_nci[] = {0x20, 0x00, 0x01, 0x01};
/*NCI_INIT_CMD*/
uint8_t cmd_init_nci[] = {0x20, 0x01, 0x00};
- static uint8_t cmd_lxdebug[] = { 0x20, 0x02, 0x06, 0x01, 0xA0, 0x1D, 0x02, 0x00, 0x00 };
uint8_t boot_mode = nxpncihal_ctrl.hal_boot_mode;
char* nfc_dev_node = NULL;
const uint16_t max_len = 260;
@@ -2719,6 +2718,7 @@
if(gParserCreated)
{
phNxpNciHal_deinitParser();
+ gParserCreated = FALSE;
}
close_and_return:
@@ -3772,36 +3772,36 @@
{
if(num == 0x00)
{
- ALOGD("Disable LxDebug");
+ NXPLOG_NCIHAL_D("Disable LxDebug");
}
else if(num == 0x01)
{
- ALOGD("Enable L1 RF NTF debugs");
+ NXPLOG_NCIHAL_D("Enable L1 RF NTF debugs");
cmd_lxdebug[7] = 0x10;
}
else if(num == 0x02)
{
- ALOGD("Enable L2 RF NTF debugs");
+ NXPLOG_NCIHAL_D("Enable L2 RF NTF debugs");
cmd_lxdebug[7] = 0x01;
}
else if(num == 0x03)
{
- ALOGD("Enable L1 & L2 RF NTF debugs");
+ NXPLOG_NCIHAL_D("Enable L1 & L2 RF NTF debugs");
cmd_lxdebug[7] = 0x31;
}
else if(num == 0x04)
{
- ALOGD("Enable L1 & L2 & RSSI NTF debugs");
+ NXPLOG_NCIHAL_D("Enable L1 & L2 & RSSI NTF debugs");
cmd_lxdebug[7] = 0x31;
cmd_lxdebug[8] = 0x01;
}
else if(num == 0x05)
{
- ALOGD("Enable L2 & Felica RF NTF debugs");
+ NXPLOG_NCIHAL_D("Enable L2 & Felica RF NTF debugs");
cmd_lxdebug[7] = 0x03;
}
else
- ALOGE("Invalid Level, Disable LxDebug");
+ NXPLOG_NCIHAL_E("Invalid Level, Disable LxDebug");
status = phNxpNciHal_send_ext_cmd(sizeof(cmd_lxdebug)/sizeof(cmd_lxdebug[0]),cmd_lxdebug);
if (status != NFCSTATUS_SUCCESS)
@@ -3810,15 +3810,16 @@
}
else {
// try initializing parser
+ NXPLOG_NCIHAL_D("Try Init Parser gParserCreated:%d",gParserCreated);
if(!gParserCreated && (cmd_lxdebug[7] != 0x00))
gParserCreated = phNxpNciHal_initParser();
if(gParserCreated) {
- phNxpNciHal_parsePacket(cmd_lxdebug,sizeof(cmd_lxdebug)/sizeof(cmd_lxdebug[0]));
NXPLOG_NCIHAL_D("Parser Initialized Successfully");
+ phNxpNciHal_parsePacket(cmd_lxdebug,sizeof(cmd_lxdebug)/sizeof(cmd_lxdebug[0]));
}
else {
- NXPLOG_NCIHAL_E("Parser Not Available");
+ NXPLOG_NCIHAL_E("Parser Library Not Available");
}
}
}
diff --git a/halimpl/pn54x/hal/phNxpNciHal_nciParser.c b/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
index 1358905..dd47828 100644
--- a/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
+++ b/halimpl/pn54x/hal/phNxpNciHal_nciParser.c
@@ -49,7 +49,7 @@
NXPLOG_NCIHAL_D("%s: enter", __FUNCTION__);
- lib_handle = dlopen(NXP_NCI_PARSER_PATH, RTLD_LAZY);
+ lib_handle = dlopen(NXP_NCI_PARSER_PATH, RTLD_NOW);
if (!lib_handle)
{
NXPLOG_NCIHAL_E("%s: dlopen failed !!!", __FUNCTION__);
diff --git a/halimpl/pn54x/hal/phNxpNciHal_nciParser.h b/halimpl/pn54x/hal/phNxpNciHal_nciParser.h
index 3617490..bffbbb3 100644
--- a/halimpl/pn54x/hal/phNxpNciHal_nciParser.h
+++ b/halimpl/pn54x/hal/phNxpNciHal_nciParser.h
@@ -24,7 +24,7 @@
#define NXP_NCI_PARSER_PATH "/system/lib64/libnxp_nciparser.so"
typedef void* (*tHAL_API_NATIVE_CREATE_PARSER)();
-typedef void* (*tHAL_API_NATIVE_DESTROY_PARSER)(void*);
+typedef void (*tHAL_API_NATIVE_DESTROY_PARSER)(void*);
typedef void (*tHAL_API_NATIVE_INIT_PARSER)(void*);
typedef void (*tHAL_API_NATIVE_DEINIT_PARSER)(void*);
typedef void (*tHAL_API_NATIVE_PARSE_PACKET)(void*,unsigned char *, unsigned short);