summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/phFriNfc_Llcp.c5
-rw-r--r--src/phFriNfc_LlcpTransport.c4
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c20
3 files changed, 15 insertions, 14 deletions
diff --git a/src/phFriNfc_Llcp.c b/src/phFriNfc_Llcp.c
index 1f66216..8138cd3 100644
--- a/src/phFriNfc_Llcp.c
+++ b/src/phFriNfc_Llcp.c
@@ -627,7 +627,7 @@ static void phFriNfc_Llcp_HandleMACLinkDeactivated( phFriNfc_Llcp_t *Llcp )
}
/* Reset state */
- Llcp->state = PHFRINFC_LLCP_STATE_DEACTIVATION;
+ Llcp->state = PHFRINFC_LLCP_STATE_RESET_INIT;
switch (state)
{
@@ -717,7 +717,8 @@ static void phFriNfc_Llcp_ResetLTO( phFriNfc_Llcp_t *Llcp )
{
Llcp->state = PHFRINFC_LLCP_STATE_OPERATION_RECV;
}
- else if (Llcp->state != PHFRINFC_LLCP_STATE_DEACTIVATION)
+ else if (Llcp->state != PHFRINFC_LLCP_STATE_DEACTIVATION &&
+ Llcp->state != PHFRINFC_LLCP_STATE_RESET_INIT)
{
/* Not yet in OPERATION state, perform first reset */
if (Llcp->eRole == phFriNfc_LlcpMac_ePeerTypeInitiator)
diff --git a/src/phFriNfc_LlcpTransport.c b/src/phFriNfc_LlcpTransport.c
index 61284bd..870aeb4 100644
--- a/src/phFriNfc_LlcpTransport.c
+++ b/src/phFriNfc_LlcpTransport.c
@@ -868,9 +868,9 @@ NFCSTATUS phFriNfc_LlcpTransport_SendFrameReject(phFriNfc_LlcpTransport_t
status = phFriNfc_LlcpTransport_ConnectionOriented_Close(&psTransport->pSocketTable[index]);
/* Set FRMR Header */
- psTransport->sLlcpHeader.dsap = dsap;
+ psTransport->sLlcpHeader.dsap = ssap;
psTransport->sLlcpHeader.ptype = PHFRINFC_LLCP_PTYPE_FRMR;
- psTransport->sLlcpHeader.ssap = ssap;
+ psTransport->sLlcpHeader.ssap = dsap;
/* Set FRMR Information Field */
flagValue = (WFlag<<7) | (IFlag<<6) | (RFlag<<5) | (SFlag<<4) | rejectedPTYPE;
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index 346558c..63e2ff5 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -491,9 +491,9 @@ static void Handle_ConnectionFrame(phFriNfc_LlcpTransport_t *psTransport,
/* Incorrect TLV */
/* send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap,
- PHFRINFC_LLCP_PTYPE_CONNECT,
dsap,
+ PHFRINFC_LLCP_PTYPE_CONNECT,
+ ssap,
0x00,
0x00,
0x00,
@@ -661,9 +661,9 @@ static void Handle_ConnectionCompleteFrame(phFriNfc_LlcpTransport_t *psTran
/* Incorrect TLV */
/* send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap,
- PHFRINFC_LLCP_PTYPE_CC,
dsap,
+ PHFRINFC_LLCP_PTYPE_CC,
+ ssap,
0x00,
0x00,
0x00,
@@ -820,9 +820,9 @@ static void Handle_DisconnetModeFrame(phFriNfc_LlcpTransport_t *psTransport
{
/* send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap,
- PHFRINFC_LLCP_PTYPE_DM,
dsap,
+ PHFRINFC_LLCP_PTYPE_DM,
+ ssap,
0x00,
0x00,
0x00,
@@ -1000,9 +1000,9 @@ static void Handle_Receive_IFrame(phFriNfc_LlcpTransport_t *psTransport,
{
/* Send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap,
- PHFRINFC_LLCP_PTYPE_I,
dsap,
+ PHFRINFC_LLCP_PTYPE_I,
+ ssap,
&sLlcpLocalSequence,
WFlag,
IFlag,
@@ -1227,7 +1227,7 @@ static void Handle_ReceiveReady_Frame(phFriNfc_LlcpTransport_t *psTransport
{
/* Send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap, PHFRINFC_LLCP_PTYPE_RR, dsap,
+ dsap, PHFRINFC_LLCP_PTYPE_RR, ssap,
&sLlcpLocalSequence,
WFlag, IFlag, RFlag, SFlag,
psLocalLlcpSocket->socket_VS,
@@ -1342,7 +1342,7 @@ static void Handle_ReceiveNotReady_Frame(phFriNfc_LlcpTransport_t *psTransp
{
/* Send FRMR */
status = phFriNfc_LlcpTransport_SendFrameReject(psTransport,
- ssap, PHFRINFC_LLCP_PTYPE_RNR, dsap,
+ dsap, PHFRINFC_LLCP_PTYPE_RNR, ssap,
&sLlcpLocalSequence,
bWFlag, bIFlag, bRFlag, bSFlag,
psLocalLlcpSocket->socket_VS,