Fork for the GitHub

Embed: (wiki syntax)

« Back to documentation index

Lib_NDEF_Vcard

Lib_NDEF_Vcard

This part of the library manage the data which follow NFC forum organisation. More...

Functions

static void NDEF_FillVcardStruct (uint8_t *pPayload, uint32_t PayloadSize, char *pKeyWord, uint32_t SizeOfKeyWord, uint8_t *pString)
 This function extracts a Vcard particular property from a vCard.
static void NDEF_ExtractVcard (sRecordInfo_t *pRecordStruct, sVcardInfo *pVcardStruct)
 This function reads a Vcard record and stores data in a `sVcardInfo` structure.
uint16_t NDEF_ReadVcard (sRecordInfo_t *pRecordStruct, sVcardInfo *pVcardStruct)
 This function reads a Vcard record and stores data in a `sVcardInfo` structure.
uint16_t NDEF_WriteVcard (sVcardInfo *pVcardStruct, I2C *mi2cChannel)
 This function writes a NDEF message to the NFC tag with the Vcard data given in a `sVcardInfo` structure.
uint32_t NDEF_GetVcardLength (sVcardInfo *pVcardStruct)
 This function computes the size of a Vcard record from the data given in the `sVcardInfo` structure.
void NDEF_PrepareVcardMessage (sVcardInfo *pVcardStruct, uint8_t *pNDEFMessage, uint16_t *size)
 This function write the NDEF file with the Vcard data given in the structure.
static uint8_t * from_base64 (uint8_t *input64, uint32_t *binary)
 This function extracts binary data from a base64 representation.
int NDEF_getVcardPicture (uint8_t *pPayload, uint32_t PayloadSize, uint8_t *pPict)
 This function return the picture stored in a VCARD.

Variables

uint8_t NDEF_Buffer []
 This buffer is used to store the data sent/received by the TAG.

Detailed Description

This part of the library manage the data which follow NFC forum organisation.


Function Documentation

static uint8_t* from_base64 ( uint8_t *  input64,
uint32_t *  binary 
) [static]

This function extracts binary data from a base64 representation.

Parameters:
input64: pointer on the input data in base64.
binary: returned binary data.
Returns:
Updated pointer on the input64 buffer (normal increment is 4 base64 char for 3 bytes of binary data, but special char are ignored)

Definition at line 525 of file lib_NDEF_Vcard.cpp.

static void NDEF_ExtractVcard ( sRecordInfo_t *  pRecordStruct,
sVcardInfo *  pVcardStruct 
) [static]

This function reads a Vcard record and stores data in a `sVcardInfo` structure.

Parameters:
pRecordStructPointer on the vCard record structure.
pVcardStructPointer on the `sCardInfo` structure to fill.

Definition at line 99 of file lib_NDEF_Vcard.cpp.

static void NDEF_FillVcardStruct ( uint8_t *  pPayload,
uint32_t  PayloadSize,
char *  pKeyWord,
uint32_t  SizeOfKeyWord,
uint8_t *  pString 
) [static]

This function extracts a Vcard particular property from a vCard.

Parameters:
pPayloadPointer on the vCard payload data of the vCard record.
PayloadSizeNumber of bytes in the vCard payload.
pKeyWordPointer on the vCard property keyword to look for.
SizeOfKeyWordNumber of bytes of the vCard property keyword we are looking for.
pStringPointer on a string used to return the vCard property read.

Definition at line 54 of file lib_NDEF_Vcard.cpp.

uint32_t NDEF_GetVcardLength ( sVcardInfo *  pVcardStruct )

This function computes the size of a Vcard record from the data given in the `sVcardInfo` structure.

Parameters:
pVcardStructPointer on a `sVcardInfo` structure containing the Vcard information.
Returns:
vCard record data size in bytes (excluding record metadata).

Definition at line 183 of file lib_NDEF_Vcard.cpp.

int NDEF_getVcardPicture ( uint8_t *  pPayload,
uint32_t  PayloadSize,
uint8_t *  pPict 
)

This function return the picture stored in a VCARD.

Parameters:
pPayload: pointer on the payload data of the NDEF message.
PayloadSize: number of data in the payload.
pPict: Pointer on the dpicture buffer (must be big enough to contain the picture - warning: no check is done in the function).

Definition at line 572 of file lib_NDEF_Vcard.cpp.

void NDEF_PrepareVcardMessage ( sVcardInfo *  pVcardStruct,
uint8_t *  pNDEFMessage,
uint16_t *  size 
)

This function write the NDEF file with the Vcard data given in the structure.

Parameters:
pVcardStruct: pointer on structure that contain the Vcard information.
pNDEFMessage: pointer on the NDEF message.
size: to store the size of the NDEF message generated.

Definition at line 297 of file lib_NDEF_Vcard.cpp.

uint16_t NDEF_ReadVcard ( sRecordInfo_t *  pRecordStruct,
sVcardInfo *  pVcardStruct 
)

This function reads a Vcard record and stores data in a `sVcardInfo` structure.

Parameters:
pRecordStructPointer on the vCard record structure.
pVcardStructPointer on the `sCardInfo` structure to fill.
Return values:
NDEF_OKThe Vcard information has been retrieved.
NDEF_ERRORNot able to retrieve the Vcard information.

Definition at line 144 of file lib_NDEF_Vcard.cpp.

uint16_t NDEF_WriteVcard ( sVcardInfo *  pVcardStruct,
I2C *  mi2cChannel 
)

This function writes a NDEF message to the NFC tag with the Vcard data given in a `sVcardInfo` structure.

Parameters:
pVcardStructPointer on a `sVcardInfo` structure containing the Vcard information.
Return values:
NDEF_OKNDEF file data written in the tag.
NDEF_ERRORNot able to store the NDEF in tag.
NDEF_ERROR_MEMORY_INTERNALCannot write to tag.
NDEF_ERROR_NOT_FORMATEDCCFile data not supported or not present.
NDEF_ERROR_MEMORY_TAGSize not compatible with memory.
NDEF_ERROR_LOCKEDTag locked, cannot be write.

Definition at line 167 of file lib_NDEF_Vcard.cpp.


Variable Documentation

uint8_t NDEF_Buffer[]

This buffer is used to store the data sent/received by the TAG.

This buffer contains the data send/received by TAG.

Definition at line 65 of file lib_NDEF.cpp.