diff options
author | Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> | 2010-11-29 10:54:08 +0100 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2010-12-05 13:15:11 -0800 |
commit | c56a3c7bc332a6656bedf342236267b636051170 (patch) | |
tree | fd0979de60362a95cbdcf27b4b7d0746f8ac68f5 /src/phFriNfc_LlcpTransport.c | |
parent | 1c75e8952d88d81c5f04826f69ca22d14bb5683b (diff) | |
download | external_libnfc-nxp-c56a3c7bc332a6656bedf342236267b636051170.zip external_libnfc-nxp-c56a3c7bc332a6656bedf342236267b636051170.tar.gz external_libnfc-nxp-c56a3c7bc332a6656bedf342236267b636051170.tar.bz2 |
Close all LLCP sockets when the link goes down.
The LLCP link status callback is now handled first in LIB layer
before being forwarded to the client. This is needed to enable the LIB layer
to detect the link status change and close the sockets accordingly.
Change-Id: I607aaebb4c0c8f2da09c81d4d43b4c705ebfcb13
Diffstat (limited to 'src/phFriNfc_LlcpTransport.c')
-rw-r--r-- | src/phFriNfc_LlcpTransport.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/phFriNfc_LlcpTransport.c b/src/phFriNfc_LlcpTransport.c index 408f058..ddc8c6a 100644 --- a/src/phFriNfc_LlcpTransport.c +++ b/src/phFriNfc_LlcpTransport.c @@ -200,6 +200,28 @@ NFCSTATUS phFriNfc_LlcpTransport_Reset (phFriNfc_LlcpTransport_t *pLlcpTran return status; } +/* TODO: comment function Transport CloseAll */ +NFCSTATUS phFriNfc_LlcpTransport_CloseAll (phFriNfc_LlcpTransport_t *pLlcpTransport) +{ + NFCSTATUS status = NFCSTATUS_SUCCESS; + uint8_t i; + + /* Check for NULL pointers */ + if(pLlcpTransport == NULL) + { + status = PHNFCSTVAL(CID_FRI_NFC_LLCP_TRANSPORT, NFCSTATUS_INVALID_PARAMETER); + } + + /* Close all sockets */ + for(i=0;i<PHFRINFC_LLCP_NB_SOCKET_MAX;i++) + { + phFriNfc_LlcpTransport_Close(&pLlcpTransport->pSocketTable[i]); + } + + return status; +} + + /** * \ingroup grp_lib_nfc * \brief <b>Get the local options of a socket</b>. |