summaryrefslogtreecommitdiffstats
path: root/src/phFriNfc_LlcpTransport_Connection.c
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2010-11-23 11:07:42 +0100
committerNick Pelly <npelly@google.com>2010-12-05 13:12:48 -0800
commitfb709589632b4962b88113346316ec53a574258b (patch)
treef4662ab454ca89cd97ed3fd6a34cbd203b786dbe /src/phFriNfc_LlcpTransport_Connection.c
parentb5b7df3c63e5fa5be47c4e815888abaf136d1e50 (diff)
downloadexternal_libnfc-nxp-fb709589632b4962b88113346316ec53a574258b.zip
external_libnfc-nxp-fb709589632b4962b88113346316ec53a574258b.tar.gz
external_libnfc-nxp-fb709589632b4962b88113346316ec53a574258b.tar.bz2
Fixed status handling in LLCP connection-oriented sent callback.
The same variable was shared for multiple usages and the status value was overwritten is some situations. One variable is now defined for each usage. Change-Id: I877cc8027a184dfe3b6d8d2832c73417f40c1ba7
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connection.c')
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index 7475b42..50c3b3d 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -54,6 +54,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
phNfc_sData_t sFrmrBuffer;
uint8_t index;
uint8_t socketFound = FALSE;
+ NFCSTATUS result;
/* Get Send CB context */
psTransport = (phFriNfc_LlcpTransport_t*)pContext;
@@ -75,7 +76,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
/* Send Pending */
psTransport->bSendPending = TRUE;
- status = phFriNfc_Llcp_Send(psTransport->pLlcp,
+ result = phFriNfc_Llcp_Send(psTransport->pLlcp,
&psTransport->sLlcpHeader,
NULL,
&sFrmrBuffer,
@@ -89,7 +90,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTransport->bDmPending = FALSE;
/* Send DM pending */
- status = phFriNfc_Llcp_Send_DisconnectMode_Frame(psTransport,
+ result = phFriNfc_Llcp_Send_DisconnectMode_Frame(psTransport,
psTransport->DmInfoBuffer[0],
psTransport->DmInfoBuffer[1],
psTransport->DmInfoBuffer[2]);
@@ -113,7 +114,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTempLlcpSocket = psTransport->pSocketTable[psTransport->socketIndex];
/* Reset the socket and set the socket state to default */
- status = phFriNfc_LlcpTransport_Close(&psTransport->pSocketTable[psTransport->socketIndex]);
+ result = phFriNfc_LlcpTransport_Close(&psTransport->pSocketTable[psTransport->socketIndex]);
/* Call the Reject Callback */
psTempLlcpSocket.pfSocketSend_Cb(psTempLlcpSocket.pRejectContext,status);
@@ -198,7 +199,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTransport->socketIndex = psLocalLlcpSocket->index ;
/* Send I_PDU */
- status = phFriNfc_Llcp_Send(psTransport->pLlcp,
+ result = phFriNfc_Llcp_Send(psTransport->pLlcp,
&psLocalLlcpSocket->sLlcpHeader,
&psLocalLlcpSocket->sSequence,
&psLocalLlcpSocket->sSocketSendBuffer,
@@ -219,7 +220,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psLocalLlcpSocket->bSocketRRPending = FALSE;
/* Send RR Frame */
- status = phFriNfc_Llcp_Send_ReceiveReady_Frame(psLocalLlcpSocket);
+ result = phFriNfc_Llcp_Send_ReceiveReady_Frame(psLocalLlcpSocket);
}
/* RNR Frame */
@@ -229,7 +230,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psLocalLlcpSocket->bSocketRNRPending = FALSE;
/* Send RNR Frame */
- status = phFriNfc_Llcp_Send_ReceiveNotReady_Frame(psLocalLlcpSocket);
+ result = phFriNfc_Llcp_Send_ReceiveNotReady_Frame(psLocalLlcpSocket);
}
/* CC Frame */
else if(psLocalLlcpSocket->bSocketAcceptPending == TRUE)
@@ -252,7 +253,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTransport->socketIndex = psLocalLlcpSocket->index;
/* Send a CC Frame */
- status = phFriNfc_Llcp_Send(psTransport->pLlcp,
+ result = phFriNfc_Llcp_Send(psTransport->pLlcp,
&psLocalLlcpSocket->sLlcpHeader,
NULL,
&psLocalLlcpSocket->sSocketSendBuffer,
@@ -275,7 +276,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psLocalLlcpSocket->eSocket_State = phFriNfc_LlcpTransportSocket_eSocketConnecting;
/* send CONNECT */
- status = phFriNfc_Llcp_Send(psTransport->pLlcp,
+ result = phFriNfc_Llcp_Send(psTransport->pLlcp,
&psLocalLlcpSocket->sLlcpHeader,
NULL,
&psLocalLlcpSocket->sSocketSendBuffer,
@@ -298,7 +299,7 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p
psTransport->socketIndex = psLocalLlcpSocket->index;
/* Send DISC */
- status = phFriNfc_Llcp_Send(psTransport->pLlcp,
+ result = phFriNfc_Llcp_Send(psTransport->pLlcp,
&psLocalLlcpSocket->sLlcpHeader,
NULL,
&psLocalLlcpSocket->sSocketSendBuffer,