Skip to content

Commit

Permalink
Merge pull request #29 from cparata/main
Browse files Browse the repository at this point in the history
Fix issue on MKR1000 board
  • Loading branch information
cparata committed Jul 21, 2023
2 parents 6a1a388 + da3ccb9 commit 3e22326
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=STM32duino ST25DV
version=2.0.2
version=2.0.3
author=STMicroelectronics
maintainer=stm32duino
sentence=Allows controlling the NFC ST25DV
Expand Down
12 changes: 6 additions & 6 deletions src/libNDEF/lib_NDEF_Vcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ uint32_t NDEF_GetVcardLength(sVcardInfo *pVcardStruct)
uint32_t PayloadSize = 0;

/* "BEGIN:VCARD\r\n" */
PayloadSize += BEGIN_STRING_SIZE;
PayloadSize += VCARD_BEGIN_STRING_SIZE;
PayloadSize += VCARD_STRING_SIZE;
PayloadSize += LIMIT_STRING_SIZE;

Expand Down Expand Up @@ -256,7 +256,7 @@ uint32_t NDEF_GetVcardLength(sVcardInfo *pVcardStruct)
PayloadSize += LIMIT_STRING_SIZE;
}
/* "END:VCARD\r\n" */
PayloadSize += END_STRING_SIZE;
PayloadSize += VCARD_END_STRING_SIZE;
PayloadSize += VCARD_STRING_SIZE;
/* PayloadSize += LIMIT_STRING_SIZE;*/

Expand Down Expand Up @@ -327,8 +327,8 @@ void NDEF::NDEF_PrepareVcardMessage(sVcardInfo *pVcardStruct, uint8_t *pNDEFMess
}

/* "BEGIN:VCARD\r\n" */
memcpy(&pNDEFMessage[PayloadSize], BEGIN, BEGIN_STRING_SIZE);
PayloadSize += BEGIN_STRING_SIZE;
memcpy(&pNDEFMessage[PayloadSize], VCARD_BEGIN, VCARD_BEGIN_STRING_SIZE);
PayloadSize += VCARD_BEGIN_STRING_SIZE;
memcpy(&pNDEFMessage[PayloadSize], VCARD, VCARD_STRING_SIZE);
PayloadSize += VCARD_STRING_SIZE;
memcpy(&pNDEFMessage[PayloadSize], LIMIT, LIMIT_STRING_SIZE);
Expand Down Expand Up @@ -460,8 +460,8 @@ void NDEF::NDEF_PrepareVcardMessage(sVcardInfo *pVcardStruct, uint8_t *pNDEFMess
}

/* "END:VCARD\r\n" */
memcpy(&pNDEFMessage[PayloadSize], END, END_STRING_SIZE);
PayloadSize += END_STRING_SIZE;
memcpy(&pNDEFMessage[PayloadSize], VCARD_END, VCARD_END_STRING_SIZE);
PayloadSize += VCARD_END_STRING_SIZE;
memcpy(&pNDEFMessage[PayloadSize], VCARD, VCARD_STRING_SIZE);
PayloadSize += VCARD_STRING_SIZE;
// memcpy( &pNDEFMessage[PayloadSize], LIMIT, LIMIT_STRING_SIZE );
Expand Down
8 changes: 4 additions & 4 deletions src/libNDEF/lib_NDEF_Vcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define VCARD_VERSION_3_0_SIZE 3


#define BEGIN "BEGIN:"
#define VCARD_BEGIN "BEGIN:"
#define VCARD "VCARD"
#define VERSION "VERSION:"
#define VCARD_NAME "N:"
Expand All @@ -60,12 +60,12 @@
#define TITLE "TITLE:"
#define ORG "ORG:"
#define URL "URL:"
#define END "END:"
#define VCARD_END "END:"
#define JPEG "JPEG"

#define LIMIT "\r\n"

#define BEGIN_STRING_SIZE 6
#define VCARD_BEGIN_STRING_SIZE 6
#define VCARD_STRING_SIZE 5
#define VERSION_STRING_SIZE 8
#define VCARD_NAME_STRING_SIZE 2
Expand All @@ -81,7 +81,7 @@
#define TITLE_STRING_SIZE 6
#define ORG_STRING_SIZE 4
#define URL_STRING_SIZE 4
#define END_STRING_SIZE 4
#define VCARD_END_STRING_SIZE 4
#define JPEG_STRING_SIZE 4

#define LIMIT_STRING_SIZE 2
Expand Down

0 comments on commit 3e22326

Please sign in to comment.