summaryrefslogtreecommitdiffstats
path: root/src/phFriNfc_Llcp.h
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2011-01-14 14:40:51 +0100
committerNick Pelly <npelly@google.com>2011-01-18 15:30:34 -0800
commit8608ad938da280b895e3bb71435d6fe34c589219 (patch)
treef22d984c16bb723bdec939c69038217150dbaaad /src/phFriNfc_Llcp.h
parenta3af9c908f5c50e2405169015c86a1b667b42490 (diff)
downloadexternal_libnfc-nxp-8608ad938da280b895e3bb71435d6fe34c589219.zip
external_libnfc-nxp-8608ad938da280b895e3bb71435d6fe34c589219.tar.gz
external_libnfc-nxp-8608ad938da280b895e3bb71435d6fe34c589219.tar.bz2
Fixed LLCP receive window checkings.
Before sending a packet, the LLCP stack have to check if the remote peer is ready to send. To do so, a Receive Window mechanism based on packet numbering and acknowledgment is used. Basically, the sender have to make sure that he must have not sent more than RW-1 unaknowledged frames before sending a new one. This patch is correcting this test which was failing in some situations. Change-Id: I525f6b472a909ce48feb938aa02858b9456edc11
Diffstat (limited to 'src/phFriNfc_Llcp.h')
-rw-r--r--src/phFriNfc_Llcp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/phFriNfc_Llcp.h b/src/phFriNfc_Llcp.h
index ce68907..4d2e71e 100644
--- a/src/phFriNfc_Llcp.h
+++ b/src/phFriNfc_Llcp.h
@@ -187,6 +187,9 @@ extern char phOsalNfc_DbgTraceBuffer[];
PHFRINFC_LLCP_TLV_MIUX_MASK) /**< Maximum size of a packet */
/*@}*/
+/*========== MACROS ===========*/
+
+#define CHECK_SEND_RW(socket) ( (((socket)->socket_VS - (socket)->socket_VSA) % 16) < (socket)->remoteRW )
/*========== ENUMERATES ===========*/