summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2011-06-27 09:01:51 -0700
committerNick Pelly <npelly@google.com>2011-06-27 09:30:36 -0700
commit34ff48f6cd6595a899e05fbd56f4c84891840d3f (patch)
tree2157358fa3ddd5309f102185c8cf278fbb078d2c
parentd4cb91ee6f74f187cc0e7ba9dc073b0a77c27dfa (diff)
downloadexternal_libnfc-nxp-34ff48f6cd6595a899e05fbd56f4c84891840d3f.zip
external_libnfc-nxp-34ff48f6cd6595a899e05fbd56f4c84891840d3f.tar.gz
external_libnfc-nxp-34ff48f6cd6595a899e05fbd56f4c84891840d3f.tar.bz2
libnfc spring cleaning
o Fix most libnfc warnings, from 360 to 18 o Make DAL_DEBUG much less verbose and more useful o Clean up Android.mk Done with minimal textual diff to minimize merge conflicts. Change-Id: I918645500723ff7bb092ad9959628fcabac45bec
-rw-r--r--Android.mk37
-rw-r--r--CleanSpec.mk53
-rw-r--r--Linux_x86/phDal4Nfc.c12
-rw-r--r--inc/phNfcConfig.h2
-rw-r--r--src/phDnldNfc.c8
-rw-r--r--src/phFriNfc_ISO15693Format.c2
-rw-r--r--src/phFriNfc_ISO15693Map.c2
-rw-r--r--src/phFriNfc_ISO15693Map.h2
-rw-r--r--src/phFriNfc_Llcp.c4
-rw-r--r--src/phFriNfc_Llcp.h2
-rw-r--r--src/phFriNfc_LlcpTransport.c2
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c2
-rw-r--r--src/phFriNfc_TopazDynamicMap.c4
-rw-r--r--src/phHciNfc.c2
-rw-r--r--src/phHciNfc_Generic.c26
-rw-r--r--src/phHciNfc_Generic.h18
-rw-r--r--src/phHciNfc_Sequence.c34
-rw-r--r--src/phLibNfc_SE.c2
-rw-r--r--src/phLibNfc_ndef_raw.c2
-rw-r--r--src/phLlcNfc_Frame.c14
-rw-r--r--src/phLlcNfc_Interface.c4
-rw-r--r--src/phLlcNfc_Timer.c6
22 files changed, 139 insertions, 101 deletions
diff --git a/Android.mk b/Android.mk
index 76f1e1f..c5182c2 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,7 +6,6 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-
LOCAL_ARM_MODE := arm
#phLibNfc
@@ -105,28 +104,17 @@ LOCAL_SRC_FILES += Linux_x86/phDal4Nfc.c
LOCAL_SRC_FILES += Linux_x86/phDal4Nfc_i2c.c
LOCAL_SRC_FILES += Linux_x86/phDal4Nfc_messageQueueLib.c
-# Really verbose:
-# LOCAL_CFLAGS += -DNXP_MESSAGING -DANDROID -DDEBUG -DDAL_TRACE -DLLC_TRACE -DLOW_LEVEL_TRACES -DINCLUDE_DALINIT_DEINIT -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -fpic
-# Just show I2C traffic:
-#LOCAL_CFLAGS += -DNXP_MESSAGING -DANDROID -DINCLUDE_DALINIT_DEINIT -DLOW_LEVEL_TRACES -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -fpic
-# Quiet:
-LOCAL_CFLAGS += -DNXP_MESSAGING -DANDROID -DINCLUDE_DALINIT_DEINIT -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -fpic
-
-ifeq ($(TARGET_ARCH),arm)
-LOCAL_CFLAGS += -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -msoft-float -Uarm -fno-common
-endif
-
-ifeq ($(NFC_BUILD_VARIANT),debug)
-LOCAL_CFLAGS += -DDEBUG -D_DEBUG
-LOCAL_CFLAGS += -O0 -g
-$(info DEBUG)
-endif
-ifeq ($(NFC_BUILD_VARIANT),release)
-LOCAL_CFLAGS += -DNDEBUG
-LOCAL_CFLAGS += -Os
-LOCAL_CFLAGS += -Wl,-s
-$(info RELEASE)
-endif
+LOCAL_CFLAGS += -DNXP_MESSAGING -DANDROID -fno-strict-aliasing
+
+# Uncomment for Chipset command/responses
+# Or use "setprop debug.nfc.LOW_LEVEL_TRACES" at run-time
+# LOCAL_CFLAGS += -DLOW_LEVEL_TRACES
+
+# Uncomment for DAL traces
+# LOCAL_CFLAGS += -DDEBUG -DDAL_TRACE
+
+# Uncomment for LLC traces
+# LOCAL_CFLAGS += -DDEBUG -DLLC_TRACE
#includes
LOCAL_CFLAGS += -I$(LOCAL_PATH)/inc
@@ -145,8 +133,6 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
-
-
LOCAL_SRC_FILES += src/phFriNfc_NdefRecord.c
LOCAL_CFLAGS += -I$(LOCAL_PATH)/inc
@@ -157,4 +143,3 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_SHARED_LIBRARY)
-
diff --git a/CleanSpec.mk b/CleanSpec.mk
new file mode 100644
index 0000000..5a4aac6
--- /dev/null
+++ b/CleanSpec.mk
@@ -0,0 +1,53 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list. These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list. E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libnfc_intermediates/)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libnfc_ndef_intermediates/)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/libnfc.so)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/libnfc_ndef.so)
diff --git a/Linux_x86/phDal4Nfc.c b/Linux_x86/phDal4Nfc.c
index df069f3..7a4986c 100644
--- a/Linux_x86/phDal4Nfc.c
+++ b/Linux_x86/phDal4Nfc.c
@@ -629,7 +629,7 @@ NFCSTATUS phDal4Nfc_Reset(long level)
{
NFCSTATUS retstatus = NFCSTATUS_SUCCESS;
- DAL_DEBUG("phDal4Nfc_Reset: VEN to %d",level);
+ DAL_DEBUG("phDal4Nfc_Reset: VEN to %ld",level);
retstatus = gLinkFunc.reset(level);
@@ -725,7 +725,7 @@ retry:
if(gReadWriteContext.nNbOfBytesToRead == 1 && gReadWriteContext.pReadBuffer[0] == 0x57)
{
i2c_error_count++;
- DAL_DEBUG("Read 0x57 %d times\n", i2c_error_count);
+ LOGW("Read 0x57 %d times\n", i2c_error_count);
if (i2c_error_count < 5) {
usleep(2000);
goto retry;
@@ -743,12 +743,12 @@ retry:
}
DAL_DEBUG("Read ok. nbToRead=%d\n", gReadWriteContext.nNbOfBytesToRead);
DAL_DEBUG("NbReallyRead=%d\n", gReadWriteContext.nNbOfBytesRead);
- DAL_PRINT("ReadBuff[]={ ");
+/* DAL_PRINT("ReadBuff[]={ ");
for (i = 0; i < gReadWriteContext.nNbOfBytesRead; i++)
{
DAL_DEBUG("0x%x ", gReadWriteContext.pReadBuffer[i]);
}
- DAL_PRINT("}\n");
+ DAL_PRINT("}\n"); */
/* read completed immediately */
sMsg.eMsgType= PHDAL4NFC_READ_MESSAGE;
@@ -910,12 +910,12 @@ void phDal4Nfc_DeferredCb (void *params)
DAL_PRINT(" Physical Write Success \n");
TransactionInfo.length=(uint16_t)gReadWriteContext.nNbOfBytesWritten;
TransactionInfo.status=NFCSTATUS_SUCCESS;
- DAL_PRINT("WriteBuff[]={ ");
+/* DAL_PRINT("WriteBuff[]={ ");
for (i = 0; i < gReadWriteContext.nNbOfBytesWritten; i++)
{
DAL_DEBUG("0x%x ", gReadWriteContext.pWriteBuffer[i]);
}
- DAL_PRINT("}\n");
+ DAL_PRINT("}\n"); */
// Free TempWriteBuffer
if(gReadWriteContext.pTempWriteBuffer != NULL)
diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h
index 563b7ae..c234724 100644
--- a/inc/phNfcConfig.h
+++ b/inc/phNfcConfig.h
@@ -254,7 +254,7 @@
#ifndef NXP_NFC_HCI_TIMER
-#define NXP_NFC_HCI_TIMER 0
+#define NXP_NFC_HCI_TIMER 1
#define NXP_NFC_HCI_TIMEOUT 6000
#endif
diff --git a/src/phDnldNfc.c b/src/phDnldNfc.c
index 76fd88b..ba56513 100644
--- a/src/phDnldNfc.c
+++ b/src/phDnldNfc.c
@@ -1690,7 +1690,7 @@ phDnldNfc_Resume(
NFCSTATUS status = NFCSTATUS_SUCCESS;
phDnldNfc_eState_t dnld_next_state = (phDnldNfc_eState_t)
psDnldContext->cur_dnld_state;
- phNfc_sCompletionInfo_t comp_info = {0};
+ phNfc_sCompletionInfo_t comp_info = {0,0,0};
switch( dnld_next_state )
{
@@ -1960,7 +1960,7 @@ phDnldNfc_Receive_Complete (
void *pdata = NULL ;
phDnldNfc_sData_Hdr_t *resp_data = NULL;
uint16_t length = 0 ;
- phNfc_sCompletionInfo_t comp_info = {0};
+ phNfc_sCompletionInfo_t comp_info = {0,0,0};
DNLD_PRINT("\n FW_DNLD: Receive Response .... ");
if ( (NULL != psContext)
@@ -2653,7 +2653,7 @@ phDnldNfc_Abort (
)
{
- phNfc_sCompletionInfo_t comp_info = {0};
+ phNfc_sCompletionInfo_t comp_info = {0,0,0};
if ( ( NULL != gpphDnldContext)
&& (abort_id == gpphDnldContext->timer_id ))
@@ -2694,7 +2694,7 @@ phDnldNfc_Upgrade (
)
{
phDnldNfc_sContext_t *psDnldContext = NULL;
- phNfcIF_sReference_t dnldReference = { NULL };
+ phNfcIF_sReference_t dnldReference = { NULL, 0, 0 };
phNfcIF_sCallBack_t if_callback = { NULL, NULL, NULL, NULL };
phNfc_sLowerIF_t *plower_if = NULL;
NFCSTATUS status = NFCSTATUS_SUCCESS;
diff --git a/src/phFriNfc_ISO15693Format.c b/src/phFriNfc_ISO15693Format.c
index 574c107..5c59156 100644
--- a/src/phFriNfc_ISO15693Format.c
+++ b/src/phFriNfc_ISO15693Format.c
@@ -1,5 +1,5 @@
/*
-/*
+ *
* Copyright (C) 2010 NXP Semiconductors
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/src/phFriNfc_ISO15693Map.c b/src/phFriNfc_ISO15693Map.c
index f07b1bf..a21d9c8 100644
--- a/src/phFriNfc_ISO15693Map.c
+++ b/src/phFriNfc_ISO15693Map.c
@@ -1,5 +1,5 @@
/*
-/*
+ *
* Copyright (C) 2010 NXP Semiconductors
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/src/phFriNfc_ISO15693Map.h b/src/phFriNfc_ISO15693Map.h
index 596534a..f4c0c08 100644
--- a/src/phFriNfc_ISO15693Map.h
+++ b/src/phFriNfc_ISO15693Map.h
@@ -1,5 +1,5 @@
/*
-/*
+ *
* Copyright (C) 2010 NXP Semiconductors
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/src/phFriNfc_Llcp.c b/src/phFriNfc_Llcp.c
index ac38311..337c31a 100644
--- a/src/phFriNfc_Llcp.c
+++ b/src/phFriNfc_Llcp.c
@@ -423,7 +423,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
break;
}
/* Get MIU */
- sParams.miu = PHFRINFC_LLCP_MIU_DEFAULT + ((sValueBuffer.buffer[0] << 8) | sValueBuffer.buffer[1]) & PHFRINFC_LLCP_TLV_MIUX_MASK;
+ sParams.miu = (PHFRINFC_LLCP_MIU_DEFAULT + ((sValueBuffer.buffer[0] << 8) | sValueBuffer.buffer[1])) & PHFRINFC_LLCP_TLV_MIUX_MASK;
break;
}
case PHFRINFC_LLCP_TLV_TYPE_WKS:
@@ -675,7 +675,7 @@ static void phFriNfc_Llcp_ChkLlcp_CB( void *pContext,
static void phFriNfc_Llcp_LinkStatus_CB( void *pContext,
phFriNfc_LlcpMac_eLinkStatus_t eLinkStatus,
phNfc_sData_t *psParamsTLV,
- phFriNfc_LlcpMac_eType_t PeerRemoteDevType)
+ phFriNfc_LlcpMac_ePeerType_t PeerRemoteDevType)
{
NFCSTATUS status;
diff --git a/src/phFriNfc_Llcp.h b/src/phFriNfc_Llcp.h
index 73fa486..a91afa5 100644
--- a/src/phFriNfc_Llcp.h
+++ b/src/phFriNfc_Llcp.h
@@ -289,7 +289,7 @@ typedef struct phFriNfc_Llcp
phFriNfc_LlcpMac_t MAC;
/**< Local LLC role*/
- phFriNfc_LlcpMac_eType_t eRole;
+ phFriNfc_LlcpMac_ePeerType_t eRole;
/**< Local link parameters*/
phFriNfc_Llcp_sLinkParameters_t sLocalParams;
diff --git a/src/phFriNfc_LlcpTransport.c b/src/phFriNfc_LlcpTransport.c
index 130564d..2ec44cf 100644
--- a/src/phFriNfc_LlcpTransport.c
+++ b/src/phFriNfc_LlcpTransport.c
@@ -227,6 +227,7 @@ NFCSTATUS phFriNfc_LlcpTransport_CloseAll (phFriNfc_LlcpTransport_t *pLlcpTransp
case phFriNfc_LlcpTransportSocket_eSocketRejected:
phFriNfc_LlcpTransport_Close(&pLlcpTransport->pSocketTable[i]);
break;
+ default: break;
}
}
else
@@ -234,7 +235,6 @@ NFCSTATUS phFriNfc_LlcpTransport_CloseAll (phFriNfc_LlcpTransport_t *pLlcpTransp
phFriNfc_LlcpTransport_Close(&pLlcpTransport->pSocketTable[i]);
}
}
-
return status;
}
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index 57723bd..2fcd5d4 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -133,9 +133,9 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTransport->pSocketTable[psTransport->socketIndex].pfSocketSend_Cb = NULL;
}
}break;
+ default: break;
}
-
/* Update Index value with the next socket */
index = psTransport->socketIndex+1;
diff --git a/src/phFriNfc_TopazDynamicMap.c b/src/phFriNfc_TopazDynamicMap.c
index 697604d..2aa29ea 100644
--- a/src/phFriNfc_TopazDynamicMap.c
+++ b/src/phFriNfc_TopazDynamicMap.c
@@ -1010,7 +1010,7 @@ phFriNfc_Tpz_H_UpdateAndWriteLockBits (
lock_byte_index = (uint8_t)(lock_byte_index + 1);
byte_index = (uint8_t)(byte_index + 1);
}
- } /* else of /* if (mod_value) */
+ } /* else of if (mod_value) */
ps_tpz_info->lock_bytes_written = remaining_lock_bits;
}
else /* if (no_of_bits_left_in_block >= remaining_lock_bits) */
@@ -3848,7 +3848,7 @@ phFriNfc_Tpz_H_CopySendWrData (
#endif /* #ifdef TOPAZ_RAW_SUPPORT */
psNdefMap->State = (uint8_t)PH_FRINFC_TOPAZ_STATE_WRITE;
- if ((write_len - psNdefMap->ApduBuffIndex) >= TOPAZ_WRITE_8_DATA_LENGTH)
+ if ((write_len - psNdefMap->ApduBuffIndex) >= (uint16_t)TOPAZ_WRITE_8_DATA_LENGTH)
{
copy_length = (uint8_t)TOPAZ_WRITE_8_DATA_LENGTH;
(void)memcpy ((void *)write_buf,
diff --git a/src/phHciNfc.c b/src/phHciNfc.c
index 9400820..d6990c1 100644
--- a/src/phHciNfc.c
+++ b/src/phHciNfc.c
@@ -95,7 +95,7 @@ phHciNfc_Config_Emulation (
)
{
phHciNfc_sContext_t *psHciContext = NULL;
- phNfcIF_sReference_t hciReference = { NULL };
+ phNfcIF_sReference_t hciReference = { NULL, 0, 0 };
phNfcIF_sCallBack_t if_callback = { NULL, NULL, NULL, NULL };
phNfc_sLowerIF_t *plower_if = NULL;
NFCSTATUS status = NFCSTATUS_SUCCESS;
diff --git a/src/phHciNfc_Generic.c b/src/phHciNfc_Generic.c
index 45aefdc..875e295 100644
--- a/src/phHciNfc_Generic.c
+++ b/src/phHciNfc_Generic.c
@@ -90,7 +90,7 @@ static phHciNfc_sContext_t *gpsHciContext= NULL;
static
void
phHciNfc_Response_Timeout (
- uint32_t resp_timer_id
+ uint32_t resp_timer_id, void *pContext
);
#endif /* (NXP_NFC_HCI_TIMER == 1) */
@@ -269,10 +269,10 @@ phHciNfc_Receive_HCP (
static
void
phHciNfc_Response_Timeout (
- uint32_t resp_timer_id
+ uint32_t resp_timer_id, void *pContext
)
{
- phNfc_sCompletionInfo_t comp_info = {0};
+ phNfc_sCompletionInfo_t comp_info = {0,0,0};
if ( ( NULL != gpsHciContext)
&& (resp_timer_id == hci_resp_timer_id ))
@@ -1147,11 +1147,11 @@ static
#ifndef EVENT_NOTIFY
( NFCSTATUS_SUCCESS == status )
|| ( NFCSTATUS_RF_TIMEOUT == status )
- || ( NFCSTATUS_MORE_INFORMATION == status )
+ || (( NFCSTATUS_MORE_INFORMATION == status )
#else
- (FALSE == psHciContext->event_pending )
+ ((FALSE == psHciContext->event_pending )
#endif
- && ( pipe_id <= PHHCINFC_MAX_PIPE )
+ && ( pipe_id <= PHHCINFC_MAX_PIPE ))
)
{
/* phHciNfc_Reset_Pipe_MsgInfo(psHciContext->p_pipe_list[pipe_id]); */
@@ -1562,11 +1562,11 @@ phHciNfc_Send_Complete (
psHciContext->tx_total = HCP_ZERO_LEN ;
psHciContext->tx_remain = HCP_ZERO_LEN ;
psHciContext->tx_hcp_frgmnt_index = HCP_ZERO_LEN ;
- HCI_DEBUG("HCI: In Function: %s \n", __FUNCTION__);
- HCI_DEBUG("HCI: Response Pending status --> %s \n",
- (psHciContext->response_pending)?"TRUE":"FALSE");
- HCI_DEBUG("HCI: Event Pending status --> %s \n",
- (psHciContext->event_pending)?"TRUE":"FALSE");
+ HCI_DEBUG("HCI: %s: response_pending=%s, event_pending=%s",
+ __FUNCTION__,
+ (psHciContext->response_pending)?"TRUE":"FALSE",
+ (psHciContext->event_pending)?"TRUE":"FALSE"
+ );
if ((TRUE == psHciContext->response_pending)
|| (TRUE == psHciContext->event_pending))
{
@@ -2015,7 +2015,7 @@ phHciNfc_Notify_Event(
if ( NXP_INVALID_TIMER_ID != hci_resp_timer_id )
{
- HCI_DEBUG(" HCI : Response Timer Stop, Status:%02X : %X\n",
+ HCI_DEBUG(" HCI : Response Timer Stop, Status:%02X",
psCompInfo->status);
/* Stop and Un-Intialise the Response Timer */
phOsalNfc_Timer_Stop( hci_resp_timer_id );
@@ -2041,7 +2041,7 @@ phHciNfc_Notify_Event(
if (( NFCSTATUS_BOARD_COMMUNICATION_ERROR == PHNFCSTATUS(psCompInfo->status))
&& ( NXP_INVALID_TIMER_ID != hci_resp_timer_id ))
{
- HCI_DEBUG(" HCI : Response Timer Stop, Status:%02X : %X\n",
+ HCI_DEBUG(" HCI : Response Timer Stop, Status:%02X",
psCompInfo->status);
/* Stop the HCI Response Timer */
phOsalNfc_Timer_Stop( hci_resp_timer_id );
diff --git a/src/phHciNfc_Generic.h b/src/phHciNfc_Generic.h
index 5410325..495e89f 100644
--- a/src/phHciNfc_Generic.h
+++ b/src/phHciNfc_Generic.h
@@ -55,11 +55,11 @@
***************************** Header File Inclusion ****************************
################################################################################
*/
-
+#define LOG_TAG "NFC-HCI"
+#include <cutils/log.h>
#include <phNfcIoctlCode.h>
#include<phNfcInterface.h>
#include <phHciNfc.h>
-
/*
################################################################################
****************************** Macro Definitions *******************************
@@ -80,14 +80,14 @@ extern char phOsalNfc_DbgTraceBuffer[];
#define MAX_TRACE_BUFFER 150
/* #define HCI_PRINT( str ) phOsalNfc_DbgTrace(str) */
#define HCI_PRINT( str ) phOsalNfc_DbgString(str)
-#define HCI_DEBUG(str, arg) \
- { \
- snprintf(Trace_buffer,MAX_TRACE_BUFFER,str,arg); \
- phOsalNfc_DbgString(Trace_buffer); \
- }
+#define HCI_DEBUG(...) LOGD(__VA_ARGS__)
+
+
+
+
#define HCI_PRINT_BUFFER(msg,buf,len) \
{ \
- snprintf(Trace_buffer,MAX_TRACE_BUFFER,"\n\t %s:",msg); \
+ snprintf(Trace_buffer,MAX_TRACE_BUFFER,"\t %s:",msg); \
phOsalNfc_DbgString(Trace_buffer); \
phOsalNfc_DbgTrace(buf,len); \
phOsalNfc_DbgString("\r"); \
@@ -101,7 +101,7 @@ extern char phOsalNfc_DbgTraceBuffer[];
#define HCI_PRINT_BUFFER(msg,buf,len)
#else
#define HCI_PRINT( str )
-#define HCI_DEBUG(str, arg)
+#define HCI_DEBUG(...)
#define HCI_PRINT_BUFFER(msg,buf,len)
#endif /* #if defined(PHDBG_TRACES) */
/* #if defined(PHDBG_INFO) && defined (PHDBG_CRITICAL_ERROR) */
diff --git a/src/phHciNfc_Sequence.c b/src/phHciNfc_Sequence.c
index 13b8ad5..73d7b79 100644
--- a/src/phHciNfc_Sequence.c
+++ b/src/phHciNfc_Sequence.c
@@ -527,16 +527,16 @@ phHciNfc_FSM_Rollback(
)
{
- HCI_DEBUG("HCI: In Function: %s \n", __FUNCTION__);
+ HCI_DEBUG("HCI: %s: transition=%02u, cur_state=%02u, next_state=%02u\n",
+ __func__,
+ psHciContext->hci_state.transition,
+ psHciContext->hci_state.cur_state,
+ psHciContext->hci_state.next_state);
+
+
+
- HCI_DEBUG(" HCI: Transition Before FSM Rollback --> %02u \n",
- psHciContext->hci_state.transition );
-
- HCI_DEBUG(" HCI: Current State Before FSM Rollback --> %02u \n",
- psHciContext->hci_state.cur_state );
- HCI_DEBUG(" HCI: Next State Before FSM Rollback --> %02u \n",
- psHciContext->hci_state.next_state );
if( (NFC_FSM_IN_PROGRESS == psHciContext->hci_state.transition)
)
@@ -716,7 +716,7 @@ phHciNfc_Error_Sequence(
case hciState_Select:
{
/* Notify the Configure failure to the upper layer */
- phNfc_sCompletionInfo_t comp_info={FALSE};
+ phNfc_sCompletionInfo_t comp_info={0,0,0};
/* Rollback the FSM as the Target Discovery Failed */
phHciNfc_FSM_Rollback(psHciContext);
@@ -776,7 +776,7 @@ phHciNfc_Error_Sequence(
case hciState_Reactivate:
{
/* Notify the General failure to the upper layer */
- phNfc_sCompletionInfo_t comp_info={FALSE};
+ phNfc_sCompletionInfo_t comp_info={FALSE, 0, 0};
/* psHciContext->host_rf_type = phHal_eUnknown_DevType;
status = phHciNfc_ReaderMgmt_Update_Sequence(
@@ -893,14 +893,14 @@ phHciNfc_Resume_Sequence(
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
-
- HCI_DEBUG("HCI: In Function: %s \n",
- __FUNCTION__);
- HCI_DEBUG(" HCI: Current HCI State --> %02u \n",
- psHciContext->hci_state.cur_state );
- HCI_DEBUG(" HCI: Next HCI State --> %02u \n",
- psHciContext->hci_state.next_state );
+ HCI_DEBUG("HCI: %s: cur_state=%02u, next_state=%02u",
+ __FUNCTION__,
+ psHciContext->hci_state.cur_state,
+ psHciContext->hci_state.next_state);
+
+
+
switch(psHciContext->hci_state.next_state)
{
diff --git a/src/phLibNfc_SE.c b/src/phLibNfc_SE.c
index 5fa4e08..06913d4 100644
--- a/src/phLibNfc_SE.c
+++ b/src/phLibNfc_SE.c
@@ -135,7 +135,7 @@ STATIC void phLibNfc_SeNotification(void *context,
{
pphLibNfc_LibContext_t pLibContext=(pphLibNfc_LibContext_t)context;
phHal_sEventInfo_t *pEvtInfo = NULL;
- phLibNfc_uSeEvtInfo_t Se_Trans_Info={0};
+ phLibNfc_uSeEvtInfo_t Se_Trans_Info={{{0,0},{0,0}}};
phLibNfc_SE_List_t *pSeInfo=NULL;
if(pLibContext != gpphLibContext)
diff --git a/src/phLibNfc_ndef_raw.c b/src/phLibNfc_ndef_raw.c
index 1e5b395..c39364e 100644
--- a/src/phLibNfc_ndef_raw.c
+++ b/src/phLibNfc_ndef_raw.c
@@ -1049,7 +1049,7 @@ STATIC void phLibNfc_Ndef_ChkNdef_Pchk_Cb(void *pContext,
NFCSTATUS status
)
{
- phLibNfc_ChkNdef_Info_t Ndef_Info = {0,0};
+ phLibNfc_ChkNdef_Info_t Ndef_Info = {0,0,0};
NFCSTATUS RetStatus = NFCSTATUS_SUCCESS;
pphLibNfc_ChkNdefRspCb_t pClientCb=NULL;
phLibNfc_LibContext_t *pLibNfc_Ctxt =
diff --git a/src/phLlcNfc_Frame.c b/src/phLlcNfc_Frame.c
index 81eb1ff..946f67f 100644
--- a/src/phLlcNfc_Frame.c
+++ b/src/phLlcNfc_Frame.c
@@ -1052,7 +1052,7 @@ phLlcNfc_H_SendTimedOutIFrame (
ns_index);
}
- PH_LLCNFC_DEBUG("SEND TIMEOUT CALL Packet : 0x%02X\n", ps_get_packet);
+ PH_LLCNFC_DEBUG("SEND TIMEOUT CALL Packet : 0x%p\n", ps_get_packet);
if (NULL != ps_get_packet)
{
llc_header = ps_get_packet->s_llcbuf.sllcpayload.llcheader;
@@ -1206,7 +1206,7 @@ phLlcNfc_H_ProcessIFrame (
phLlcNfc_eSentFrameType_t eframe_type = invalid_frame;
uint8_t dont_send_s_frame = FALSE;
uint8_t no_of_del_frames = 0;
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
#ifdef RECV_NR_CHECK_ENABLE
uint8_t recvd_nr = 0;
@@ -1374,8 +1374,8 @@ phLlcNfc_H_ProcessIFrame (
#ifdef LLC_RR_INSTEAD_OF_REJ
if (((ps_frame_info->n_r > 0) && (ns_index == (ps_frame_info->n_r - 1)))
- || (0 == ps_frame_info->n_r) &&
- (ns_index == (PH_LLCNFC_MOD_NS_NR - 1)))
+ || ((0 == ps_frame_info->n_r) &&
+ (ns_index == (PH_LLCNFC_MOD_NS_NR - 1))))
{
cmdtype = phLlcNfc_e_rr;
eframe_type = rej_rr_s_frame;
@@ -1465,7 +1465,7 @@ phLlcNfc_H_ProcessUFrame (
phLlcNfc_Frame_t *ps_frame_info = NULL;
phLlcNfc_LlcPacket_t *ps_uframe_pkt = NULL;
#ifdef LLC_URSET_NO_DELAY
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
#else /* #ifdef LLC_URSET_NO_DELAY */
uint32_t delay_timer_id =
PH_OSALNFC_INVALID_TIMER_ID;
@@ -1580,12 +1580,12 @@ phLlcNfc_H_ProcessSFrame (
#if 0
prev_win_count = 0;
#endif /* #if 0 */
- phNfc_sTransactionInfo_t compinfo = {0};
+ phNfc_sTransactionInfo_t compinfo = {0, 0, 0, 0, 0};
phLlcNfc_Frame_t *ps_frame_info = NULL;
phLlcNfc_StoreIFrame_t *ps_store_frame = NULL;
phLlcNfc_LlcPacket_t *ps_recv_pkt = NULL;
uint8_t no_of_del_frames = 0;
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
ps_frame_info = &(psLlcCtxt->s_frameinfo);
ps_recv_pkt = &(ps_frame_info->s_recvpacket);
diff --git a/src/phLlcNfc_Interface.c b/src/phLlcNfc_Interface.c
index 92be48d..871481b 100644
--- a/src/phLlcNfc_Interface.c
+++ b/src/phLlcNfc_Interface.c
@@ -223,8 +223,8 @@ phLlcNfc_Interface_Write(
(0 == llcBufferLength) ||
(NULL == psLlcCtxt->lower_if.send))
{
- PH_LLCNFC_DEBUG ("psLlcCtxt : 0x%08X\n", psLlcCtxt);
- PH_LLCNFC_DEBUG ("pLlcBuffer : 0x%08X\n", pLlcBuffer);
+ PH_LLCNFC_DEBUG ("psLlcCtxt : 0x%p\n", psLlcCtxt);
+ PH_LLCNFC_DEBUG ("pLlcBuffer : 0x%p\n", pLlcBuffer);
PH_LLCNFC_DEBUG ("llcBufferLength : 0x%08X\n", llcBufferLength);
result = PHNFCSTVAL(CID_NFC_LLC, NFCSTATUS_INVALID_PARAMETER);
}
diff --git a/src/phLlcNfc_Timer.c b/src/phLlcNfc_Timer.c
index 9a596b4..c079760 100644
--- a/src/phLlcNfc_Timer.c
+++ b/src/phLlcNfc_Timer.c
@@ -606,7 +606,7 @@ phLlcNfc_GuardTimeoutCb (
uint8_t index = 0;
uint8_t zero_to_index = 0;
#if defined (GUARD_TO_ERROR)
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
#endif /* #if defined (GUARD_TO_ERROR) */
PHNFC_UNUSED_VARIABLE(pContext);
@@ -800,7 +800,7 @@ phLlcNfc_ConnectionTimeoutCb (
)
{
NFCSTATUS result = NFCSTATUS_SUCCESS;
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
pphNfcIF_Notification_CB_t notifyul = NULL;
void *p_upperctxt = NULL;
phLlcNfc_Frame_t *ps_frame_info = NULL;
@@ -927,7 +927,7 @@ phLlcNfc_URSET_Delay_Notify (
void *pContext)
{
phLlcNfc_Frame_t *ps_frame_info = NULL;
- phNfc_sCompletionInfo_t notifyinfo = {0};
+ phNfc_sCompletionInfo_t notifyinfo = {0,0,0};
if (NULL != gpphLlcNfc_Ctxt)
{