diff options
-rw-r--r-- | src/phFriNfc_LlcpTransport.c | 2 | ||||
-rw-r--r-- | src/phFriNfc_LlcpTransport_Connection.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/phFriNfc_LlcpTransport.c b/src/phFriNfc_LlcpTransport.c index ddc8c6a..8613669 100644 --- a/src/phFriNfc_LlcpTransport.c +++ b/src/phFriNfc_LlcpTransport.c @@ -1137,7 +1137,7 @@ NFCSTATUS phFriNfc_LlcpTransport_Recv( phFriNfc_LlcpTransport_Socket_t* pRecv_RspCb(pContext,status); } /* Test if the socket is in connected state */ - else if(pLlcpSocket->eSocket_State != phFriNfc_LlcpTransportSocket_eSocketConnected) + else if(pLlcpSocket->eSocket_State == phFriNfc_LlcpTransportSocket_eSocketDefault) { status = PHNFCSTVAL(CID_FRI_NFC_LLCP_TRANSPORT, NFCSTATUS_INVALID_PARAMETER); /* Call the CB */ diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c index 4b89bbb..2056f45 100644 --- a/src/phFriNfc_LlcpTransport_Connection.c +++ b/src/phFriNfc_LlcpTransport_Connection.c @@ -2680,6 +2680,13 @@ NFCSTATUS phFriNfc_LlcpTransport_ConnectionOriented_Recv( phFriNfc_LlcpTransport /* Test if the WorkingBuffer Length is null */ if(pLlcpSocket->bufferLinearLength == 0) { + if (pLlcpSocket->eSocket_State != phFriNfc_LlcpTransportSocket_eSocketConnected) + { + /* Call the Receive CB */ + pRecv_RspCb(pContext,NFCSTATUS_FAILED); + return NFCSTATUS_SUCCESS; + } + /* Test If data is present in the RW Buffer */ if(pLlcpSocket->indexRwRead != pLlcpSocket->indexRwWrite) { @@ -2805,6 +2812,13 @@ NFCSTATUS phFriNfc_LlcpTransport_ConnectionOriented_Recv( phFriNfc_LlcpTransport } else { + if (pLlcpSocket->eSocket_State != phFriNfc_LlcpTransportSocket_eSocketConnected) + { + /* Call the Receive CB */ + pRecv_RspCb(pContext,NFCSTATUS_FAILED); + return NFCSTATUS_SUCCESS; + } + /* Set Receive pending */ pLlcpSocket->bSocketRecvPending = TRUE; |