summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan REBRACA <dejanx.rebraca@intel.com>2012-04-27 09:45:44 +0200
committerShuo Gao <shuo.gao@intel.com>2012-08-14 21:52:39 +0800
commitbc2d3c02e53ac97e6708356baae431889f92ce1d (patch)
treeb67a896dd8369506c476b1fd89e51378d2f3444d
parentb668d06f9447b613f6e8e65817e12ccd8d2b6225 (diff)
downloadexternal_libnfc-nxp-bc2d3c02e53ac97e6708356baae431889f92ce1d.zip
external_libnfc-nxp-bc2d3c02e53ac97e6708356baae431889f92ce1d.tar.gz
external_libnfc-nxp-bc2d3c02e53ac97e6708356baae431889f92ce1d.tar.bz2
Support of topaz tag NFC Forum version number 1.1
The latest version of NFC forum Tag type 1 spec is 1.1. This version number needs to be supported by libnfc to support Topaz tags V1.1 with dynamic content. Version number is part of capability container which resides in segment 1 of EEPROM memory of the tag. For older versions of Tag type 1, NFC device may be backward compatible. Change-Id: Ibbfa720d2e34c2f2612579e368f31f4a5c66b465 Author: Dejan REBRACA <dejanx.rebraca@intel.com> Signed-off-by: Dejan REBRACA <dejanx.rebraca@intel.com> Signed-off-by: Sebastian Niciarz <sebastian.niciarz@intel.com> Singed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 33236
-rw-r--r--src/phFriNfc_TopazDynamicMap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/phFriNfc_TopazDynamicMap.c b/src/phFriNfc_TopazDynamicMap.c
index 2aa29ea..e9d1529 100644
--- a/src/phFriNfc_TopazDynamicMap.c
+++ b/src/phFriNfc_TopazDynamicMap.c
@@ -199,6 +199,9 @@ so there are 4 segements in the card */
((((block_no) + 1) == TOPAZ_STATIC_LOCK_FIRST_BLOCK_NO) ? \
(((block_no) + 1) + TOPAZ_STATIC_LOCK_BLOCK_AREAS) : \
((block_no) + 1))
+/* Check topaz spec version number */
+#define TOPAZ_COMPARE_VERSION(device_ver, tag_ver) \
+ ((device_ver & 0xF0) >= (tag_ver & 0xF0))
#ifdef FRINFC_READONLY_NDEF
@@ -2368,7 +2371,7 @@ phFriNfc_Tpz_H_CheckCCBytesForWrite (
{
check_index = (uint8_t)(check_index + 1);
- if ((check_cc_rw[0] != ps_tpz_info->CCByteBuf[1]) ||
+ if ((!TOPAZ_COMPARE_VERSION(check_cc_rw[0], ps_tpz_info->CCByteBuf[1])) ||
(check_cc_rw[1] != ps_tpz_info->CCByteBuf[2]) ||
(check_cc_rw[2] != ps_tpz_info->CCByteBuf[3]))
{