diff options
author | Martijn Coenen <maco@google.com> | 2013-03-06 13:31:30 -0800 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2013-03-06 13:31:30 -0800 |
commit | 3cbab5882f6d89a52068a3fa72a7223971d6b7fd (patch) | |
tree | a70d30d3b9073519c7e91bcd747f67d02563c2b9 /src/phFriNfc_LlcpTransport_Connection.c | |
parent | 837efc3194a03beaaa32b370c63a9270ed9664d8 (diff) | |
download | android_external_libnfc-nxp-3cbab5882f6d89a52068a3fa72a7223971d6b7fd.tar.gz android_external_libnfc-nxp-3cbab5882f6d89a52068a3fa72a7223971d6b7fd.tar.bz2 android_external_libnfc-nxp-3cbab5882f6d89a52068a3fa72a7223971d6b7fd.zip |
Make sure LLCP header fields are reset.
In some conditions these would persist
over a link tear-down, causing them to
be sent out the next time the link comes up.
Also, don't overwrite them if a send is
still in progress.
Change-Id: I19dec5d79ae4b25f41fb5e8a0514e565ceca7a91
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connection.c')
-rw-r--r-- | src/phFriNfc_LlcpTransport_Connection.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c index 4f7badf..f4be919 100644 --- a/src/phFriNfc_LlcpTransport_Connection.c +++ b/src/phFriNfc_LlcpTransport_Connection.c @@ -52,7 +52,6 @@ static void phFriNfc_LlcpTransport_ConnectionOriented_SendLlcp_CB(void* p uint8_t index; uint8_t socketFound = FALSE; NFCSTATUS result; - /* Get Send CB context */ psTransport = (phFriNfc_LlcpTransport_t*)pContext; @@ -227,7 +226,6 @@ NFCSTATUS phFriNfc_LlcpTransport_ConnectionOriented_HandlePendingOperations(phFr pSocket->pSocketErrCb(pSocket->pContext, PHFRINFC_LLCP_ERR_DISCONNECTED); } } - return result; } @@ -2053,11 +2051,6 @@ NFCSTATUS phLibNfc_LlcpTransport_ConnectionOriented_Disconnect(phFriNfc_LlcpTran } } - /* Set the socket Header */ - pLlcpSocket->sLlcpHeader.dsap = pLlcpSocket->socket_dSap; - pLlcpSocket->sLlcpHeader.ptype = PHFRINFC_LLCP_PTYPE_DISC; - pLlcpSocket->sLlcpHeader.ssap = pLlcpSocket->socket_sSap; - /* Test if a send is pending */ if( testAndSetSendPending(pLlcpSocket->psTransport)) { @@ -2066,6 +2059,11 @@ NFCSTATUS phLibNfc_LlcpTransport_ConnectionOriented_Disconnect(phFriNfc_LlcpTran } else { + /* Set the socket Header */ + pLlcpSocket->sLlcpHeader.dsap = pLlcpSocket->socket_dSap; + pLlcpSocket->sLlcpHeader.ptype = PHFRINFC_LLCP_PTYPE_DISC; + pLlcpSocket->sLlcpHeader.ssap = pLlcpSocket->socket_sSap; + status = phFriNfc_LlcpTransport_LinkSend(pLlcpSocket->psTransport, &pLlcpSocket->sLlcpHeader, NULL, |