summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/phFriNfc_LlcpTransport.c11
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c6
2 files changed, 14 insertions, 3 deletions
diff --git a/src/phFriNfc_LlcpTransport.c b/src/phFriNfc_LlcpTransport.c
index 38c6807..158dbc2 100644
--- a/src/phFriNfc_LlcpTransport.c
+++ b/src/phFriNfc_LlcpTransport.c
@@ -544,7 +544,6 @@ static void phFriNfc_LlcpTransport_Send_CB(void *pContext,
uint8_t index;
/* 1 - Reset the FLAG send pending*/
-
psTransport->bSendPending = FALSE;
/* 2 - Handle pending error responses */
@@ -800,18 +799,24 @@ NFCSTATUS phFriNfc_LlcpTransport_LinkSend( phFriNfc_LlcpTransport_t *Llc
phFriNfc_Llcp_Send_CB_t pfSend_CB,
void *pContext )
{
+ NFCSTATUS status;
/* Check if a send is already ongoing */
if (LlcpTransport->pfLinkSendCb != NULL)
{
return NFCSTATUS_BUSY;
}
-
/* Save callback details */
LlcpTransport->pfLinkSendCb = pfSend_CB;
LlcpTransport->pLinkSendContext = pContext;
/* Call the link-level send function */
- return phFriNfc_Llcp_Send(LlcpTransport->pLlcp, psHeader, psSequence, psInfo, phFriNfc_LlcpTransport_Send_CB, (void*)LlcpTransport);
+ status = phFriNfc_Llcp_Send(LlcpTransport->pLlcp, psHeader, psSequence, psInfo, phFriNfc_LlcpTransport_Send_CB, (void*)LlcpTransport);
+ if (status != NFCSTATUS_PENDING && status != NFCSTATUS_SUCCESS) {
+ // Clear out callbacks
+ LlcpTransport->pfLinkSendCb = NULL;
+ LlcpTransport->pLinkSendContext = NULL;
+ }
+ return status;
}
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index a11945f..a40c505 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -316,6 +316,9 @@ static NFCSTATUS phFriNfc_Llcp_Send_ReceiveReady_Frame(phFriNfc_LlcpTransport_So
}
else
{
+ /* Set transport to pending */
+ pLlcpSocket->psTransport->bSendPending = TRUE;
+
/* Set the header of the RR frame */
pLlcpSocket->sLlcpHeader.dsap = pLlcpSocket->socket_dSap;
pLlcpSocket->sLlcpHeader.ptype = PHFRINFC_LLCP_PTYPE_RR;
@@ -356,6 +359,9 @@ static NFCSTATUS phFriNfc_Llcp_Send_ReceiveNotReady_Frame(phFriNfc_LlcpTransport
}
else
{
+ /* Set transport to pending */
+ pLlcpSocket->psTransport->bSendPending = TRUE;
+
/* Set the header of the RNR frame */
pLlcpSocket->sLlcpHeader.dsap = pLlcpSocket->socket_dSap;
pLlcpSocket->sLlcpHeader.ptype = PHFRINFC_LLCP_PTYPE_RNR;