Fork for the GitHub
lib_NDEF_Vcard.h@0:de13951f30f6, 2019-11-14 (annotated)
- Committer:
- DiegoOstuni
- Date:
- Thu Nov 14 10:34:11 2019 +0000
- Revision:
- 0:de13951f30f6
Add files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DiegoOstuni | 0:de13951f30f6 | 1 | /** |
DiegoOstuni | 0:de13951f30f6 | 2 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 3 | * @file lib_NDEF_Vcard.h |
DiegoOstuni | 0:de13951f30f6 | 4 | * @author MMY Application Team |
DiegoOstuni | 0:de13951f30f6 | 5 | * @version $Revision: 2892 $ |
DiegoOstuni | 0:de13951f30f6 | 6 | * @date $Date: 2016-09-19 11:03:26 +0200 (Mon, 19 Sep 2016) $ |
DiegoOstuni | 0:de13951f30f6 | 7 | * @brief This file help to manage Vcard NDEF file. |
DiegoOstuni | 0:de13951f30f6 | 8 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 9 | * @attention |
DiegoOstuni | 0:de13951f30f6 | 10 | * |
DiegoOstuni | 0:de13951f30f6 | 11 | * <h2><center>© COPYRIGHT 2015 STMicroelectronics</center></h2> |
DiegoOstuni | 0:de13951f30f6 | 12 | * |
DiegoOstuni | 0:de13951f30f6 | 13 | * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); |
DiegoOstuni | 0:de13951f30f6 | 14 | * You may not use this file except in compliance with the License. |
DiegoOstuni | 0:de13951f30f6 | 15 | * You may obtain a copy of the License at: |
DiegoOstuni | 0:de13951f30f6 | 16 | * |
DiegoOstuni | 0:de13951f30f6 | 17 | * http://www.st.com/myliberty |
DiegoOstuni | 0:de13951f30f6 | 18 | * |
DiegoOstuni | 0:de13951f30f6 | 19 | * Unless required by applicable law or agreed to in writing, software |
DiegoOstuni | 0:de13951f30f6 | 20 | * distributed under the License is distributed on an "AS IS" BASIS, |
DiegoOstuni | 0:de13951f30f6 | 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
DiegoOstuni | 0:de13951f30f6 | 22 | * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, |
DiegoOstuni | 0:de13951f30f6 | 23 | * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. |
DiegoOstuni | 0:de13951f30f6 | 24 | * See the License for the specific language governing permissions and |
DiegoOstuni | 0:de13951f30f6 | 25 | * limitations under the License. |
DiegoOstuni | 0:de13951f30f6 | 26 | * |
DiegoOstuni | 0:de13951f30f6 | 27 | ****************************************************************************** |
DiegoOstuni | 0:de13951f30f6 | 28 | */ |
DiegoOstuni | 0:de13951f30f6 | 29 | |
DiegoOstuni | 0:de13951f30f6 | 30 | /* Define to prevent recursive inclusion -------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 31 | #ifndef __LIB_NDEF_VCARD_H |
DiegoOstuni | 0:de13951f30f6 | 32 | #define __LIB_NDEF_VCARD_H |
DiegoOstuni | 0:de13951f30f6 | 33 | |
DiegoOstuni | 0:de13951f30f6 | 34 | |
DiegoOstuni | 0:de13951f30f6 | 35 | /* Includes ------------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 36 | #include "lib_NDEF.h" |
DiegoOstuni | 0:de13951f30f6 | 37 | |
DiegoOstuni | 0:de13951f30f6 | 38 | |
DiegoOstuni | 0:de13951f30f6 | 39 | #define VCARD_VERSION_2_1 "2.1" |
DiegoOstuni | 0:de13951f30f6 | 40 | #define VCARD_VERSION_2_1_SIZE 3 |
DiegoOstuni | 0:de13951f30f6 | 41 | |
DiegoOstuni | 0:de13951f30f6 | 42 | #define VCARD_VERSION_3_0 "3.0" |
DiegoOstuni | 0:de13951f30f6 | 43 | #define VCARD_VERSION_3_0_SIZE 3 |
DiegoOstuni | 0:de13951f30f6 | 44 | |
DiegoOstuni | 0:de13951f30f6 | 45 | |
DiegoOstuni | 0:de13951f30f6 | 46 | #define BEGIN "BEGIN:" |
DiegoOstuni | 0:de13951f30f6 | 47 | #define VCARD "VCARD" |
DiegoOstuni | 0:de13951f30f6 | 48 | #define VERSION "VERSION:" |
DiegoOstuni | 0:de13951f30f6 | 49 | #define VCARD_NAME "N:" |
DiegoOstuni | 0:de13951f30f6 | 50 | // TODO: rename FIRSTNAME into FORMATTEDNAME |
DiegoOstuni | 0:de13951f30f6 | 51 | #define FIRSTNAME "FN:" |
DiegoOstuni | 0:de13951f30f6 | 52 | #define HOME_TEL "TEL;HOME:" |
DiegoOstuni | 0:de13951f30f6 | 53 | #define WORK_TEL "TEL;WORK:" |
DiegoOstuni | 0:de13951f30f6 | 54 | #define CELL_TEL "TEL;CELL:" |
DiegoOstuni | 0:de13951f30f6 | 55 | #define HOME_EMAIL "EMAIL;HOME:" |
DiegoOstuni | 0:de13951f30f6 | 56 | #define WORK_EMAIL "EMAIL;WORK:" |
DiegoOstuni | 0:de13951f30f6 | 57 | #define GEN_EMAIL "EMAIL:" |
DiegoOstuni | 0:de13951f30f6 | 58 | #define HOME_ADDRESS "ADR;HOME:" |
DiegoOstuni | 0:de13951f30f6 | 59 | #define WORK_ADDRESS "ADR;WORK:" |
DiegoOstuni | 0:de13951f30f6 | 60 | #define GEN_ADDRESS "ADR:" |
DiegoOstuni | 0:de13951f30f6 | 61 | #define TITLE "TITLE:" |
DiegoOstuni | 0:de13951f30f6 | 62 | #define ORG "ORG:" |
DiegoOstuni | 0:de13951f30f6 | 63 | #define URL "URL:" |
DiegoOstuni | 0:de13951f30f6 | 64 | #define END "END:" |
DiegoOstuni | 0:de13951f30f6 | 65 | #define JPEG "JPEG" |
DiegoOstuni | 0:de13951f30f6 | 66 | |
DiegoOstuni | 0:de13951f30f6 | 67 | #define LIMIT "\r\n" |
DiegoOstuni | 0:de13951f30f6 | 68 | |
DiegoOstuni | 0:de13951f30f6 | 69 | #define BEGIN_STRING_SIZE 6 |
DiegoOstuni | 0:de13951f30f6 | 70 | #define VCARD_STRING_SIZE 5 |
DiegoOstuni | 0:de13951f30f6 | 71 | #define VERSION_STRING_SIZE 8 |
DiegoOstuni | 0:de13951f30f6 | 72 | #define VCARD_NAME_STRING_SIZE 2 |
DiegoOstuni | 0:de13951f30f6 | 73 | // TODO: rename FIRSTNAME into FORMATTEDNAME |
DiegoOstuni | 0:de13951f30f6 | 74 | #define FIRSTNAME_STRING_SIZE 3 |
DiegoOstuni | 0:de13951f30f6 | 75 | #define HOME_TEL_STRING_SIZE 9 |
DiegoOstuni | 0:de13951f30f6 | 76 | #define WORK_TEL_STRING_SIZE 9 |
DiegoOstuni | 0:de13951f30f6 | 77 | #define CELL_TEL_STRING_SIZE 9 |
DiegoOstuni | 0:de13951f30f6 | 78 | #define HOME_EMAIL_STRING_SIZE 11 |
DiegoOstuni | 0:de13951f30f6 | 79 | #define WORK_EMAIL_STRING_SIZE 11 |
DiegoOstuni | 0:de13951f30f6 | 80 | #define HOME_ADDRESS_STRING_SIZE 9 |
DiegoOstuni | 0:de13951f30f6 | 81 | #define WORK_ADDRESS_STRING_SIZE 9 |
DiegoOstuni | 0:de13951f30f6 | 82 | #define TITLE_STRING_SIZE 6 |
DiegoOstuni | 0:de13951f30f6 | 83 | #define ORG_STRING_SIZE 4 |
DiegoOstuni | 0:de13951f30f6 | 84 | #define URL_STRING_SIZE 4 |
DiegoOstuni | 0:de13951f30f6 | 85 | #define END_STRING_SIZE 4 |
DiegoOstuni | 0:de13951f30f6 | 86 | #define JPEG_STRING_SIZE 4 |
DiegoOstuni | 0:de13951f30f6 | 87 | |
DiegoOstuni | 0:de13951f30f6 | 88 | #define LIMIT_STRING_SIZE 2 |
DiegoOstuni | 0:de13951f30f6 | 89 | |
DiegoOstuni | 0:de13951f30f6 | 90 | typedef struct |
DiegoOstuni | 0:de13951f30f6 | 91 | { |
DiegoOstuni | 0:de13951f30f6 | 92 | char Version [10]; |
DiegoOstuni | 0:de13951f30f6 | 93 | char Name[80]; |
DiegoOstuni | 0:de13951f30f6 | 94 | // TODO: rename FirstName into FormattedName |
DiegoOstuni | 0:de13951f30f6 | 95 | char FirstName[80]; |
DiegoOstuni | 0:de13951f30f6 | 96 | char Title[80]; |
DiegoOstuni | 0:de13951f30f6 | 97 | char Org[80]; |
DiegoOstuni | 0:de13951f30f6 | 98 | char HomeAddress[80]; |
DiegoOstuni | 0:de13951f30f6 | 99 | char WorkAddress[80]; |
DiegoOstuni | 0:de13951f30f6 | 100 | char Address[80]; |
DiegoOstuni | 0:de13951f30f6 | 101 | char HomeTel[40]; |
DiegoOstuni | 0:de13951f30f6 | 102 | char WorkTel[40]; |
DiegoOstuni | 0:de13951f30f6 | 103 | char CellTel[40]; |
DiegoOstuni | 0:de13951f30f6 | 104 | char HomeEmail[80]; |
DiegoOstuni | 0:de13951f30f6 | 105 | char WorkEmail[80]; |
DiegoOstuni | 0:de13951f30f6 | 106 | char Email[80]; |
DiegoOstuni | 0:de13951f30f6 | 107 | char Url[80]; |
DiegoOstuni | 0:de13951f30f6 | 108 | }sVcardInfo; |
DiegoOstuni | 0:de13951f30f6 | 109 | |
DiegoOstuni | 0:de13951f30f6 | 110 | uint16_t NDEF_ReadVcard( sRecordInfo_t *pRecordStruct, sVcardInfo *pVcardStruct ); |
DiegoOstuni | 0:de13951f30f6 | 111 | uint16_t NDEF_WriteVcard( sVcardInfo *pVcardStruct, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 112 | void NDEF_PrepareVcardMessage( sVcardInfo *pVcardStruct, uint8_t *pNDEFMessage, uint16_t *size ); |
DiegoOstuni | 0:de13951f30f6 | 113 | int NDEF_getVcardPicture( uint8_t* pPayload, uint32_t PayloadSize, uint8_t* pPict ); |
DiegoOstuni | 0:de13951f30f6 | 114 | |
DiegoOstuni | 0:de13951f30f6 | 115 | |
DiegoOstuni | 0:de13951f30f6 | 116 | #endif /* __LIB_NDEF_VCARD_H */ |
DiegoOstuni | 0:de13951f30f6 | 117 | |
DiegoOstuni | 0:de13951f30f6 | 118 | |
DiegoOstuni | 0:de13951f30f6 | 119 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |