PN532 Driver library This library provides an abstract API to drive the pn532 nfc chip, with I2C/HSU/SPI interface. Its based on the Seeed Studio's Arduino version.

Dependents:   nfc_interfacage

Files at this revision

API Documentation at this revision

Comitter:
maximemau
Date:
Fri Jun 26 09:16:19 2020 +0000
Parent:
1:b5922b3b3257
Commit message:
lib_pn532

Changed in this revision

PN532/PN532.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b5922b3b3257 -r ae258f195bbd PN532/PN532.cpp
--- a/PN532/PN532.cpp	Tue Sep 13 06:17:35 2016 +0000
+++ b/PN532/PN532.cpp	Fri Jun 26 09:16:19 2020 +0000
@@ -550,6 +550,7 @@
 /**************************************************************************/
 uint8_t PN532::mifareclassic_WriteNDEFURI (uint8_t sectorNumber, uint8_t uriIdentifier, const char *url)
 {
+    uint8_t len1,len2;
     // Figure out how long the string is
     uint8_t len = strlen(url);
 
@@ -563,9 +564,10 @@
 
     // Note 0xD3 0xF7 0xD3 0xF7 0xD3 0xF7 must be used for key A
     // in NDEF records
-
+    len1=len+5;
+    len2=len+1;
     // Setup the sector buffer (w/pre-formatted TLV wrapper and NDEF message)
-    uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, len + 5, 0xD1, 0x01, len + 1, 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+    uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, len1, 0xD1, 0x01, len2, 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
     uint8_t sectorbuffer2[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
     uint8_t sectorbuffer3[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
     uint8_t sectorbuffer4[16] = {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7, 0x7F, 0x07, 0x88, 0x40, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};