summaryrefslogtreecommitdiffstats
path: root/src/phFriNfc_Llcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/phFriNfc_Llcp.c')
-rw-r--r--src/phFriNfc_Llcp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/phFriNfc_Llcp.c b/src/phFriNfc_Llcp.c
index cfbda3a..ab9b768 100644
--- a/src/phFriNfc_Llcp.c
+++ b/src/phFriNfc_Llcp.c
@@ -143,6 +143,8 @@ static void phFriNfc_Llcp_Deallocate(phNfc_sData_t * pData)
static NFCSTATUS phFriNfc_Llcp_InternalDeactivate( phFriNfc_Llcp_t *Llcp )
{
+ phFriNfc_Llcp_Send_CB_t pfSendCB;
+ void * pSendContext;
if ((Llcp->state == PHFRINFC_LLCP_STATE_OPERATION_RECV) ||
(Llcp->state == PHFRINFC_LLCP_STATE_OPERATION_SEND) ||
(Llcp->state == PHFRINFC_LLCP_STATE_PAX) ||
@@ -154,6 +156,25 @@ static NFCSTATUS phFriNfc_Llcp_InternalDeactivate( phFriNfc_Llcp_t *Llcp )
/* Stop timer */
phOsalNfc_Timer_Stop(Llcp->hSymmTimer);
+ /* Return delayed send operation in error, in any */
+ if (Llcp->psSendInfo != NULL)
+ {
+ phFriNfc_Llcp_Deallocate(Llcp->psSendInfo);
+ Llcp->psSendHeader = NULL;
+ Llcp->psSendSequence = NULL;
+ }
+ if (Llcp->pfSendCB != NULL)
+ {
+ /* Get Callback params */
+ pfSendCB = Llcp->pfSendCB;
+ pSendContext = Llcp->pSendContext;
+ /* Reset callback params */
+ Llcp->pfSendCB = NULL;
+ Llcp->pSendContext = NULL;
+ /* Call the callback */
+ (pfSendCB)(pSendContext, NFCSTATUS_FAILED);
+ }
+
/* Notify service layer */
Llcp->pfLink_CB(Llcp->pLinkContext, phFriNfc_LlcpMac_eLinkDeactivated);