Fork for the GitHub
lib_NDEF.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.h |
DiegoOstuni | 0:de13951f30f6 | 4 | * @author MMY Application Team |
DiegoOstuni | 0:de13951f30f6 | 5 | * @version $Revision: 2762 $ |
DiegoOstuni | 0:de13951f30f6 | 6 | * @date $Date: 2016-08-10 16:40:40 +0200 (Wed, 10 Aug 2016) $ |
DiegoOstuni | 0:de13951f30f6 | 7 | * @brief This file help to manage 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_H |
DiegoOstuni | 0:de13951f30f6 | 32 | #define __LIB_NDEF_H |
DiegoOstuni | 0:de13951f30f6 | 33 | |
DiegoOstuni | 0:de13951f30f6 | 34 | /* Includes ------------------------------------------------------------------*/ |
DiegoOstuni | 0:de13951f30f6 | 35 | /* include file which match the HW configuration */ |
DiegoOstuni | 0:de13951f30f6 | 36 | #include "lib_wrapper.h" |
DiegoOstuni | 0:de13951f30f6 | 37 | #include <string.h> |
DiegoOstuni | 0:de13951f30f6 | 38 | |
DiegoOstuni | 0:de13951f30f6 | 39 | |
DiegoOstuni | 0:de13951f30f6 | 40 | |
DiegoOstuni | 0:de13951f30f6 | 41 | #define NDEF_ACTION_COMPLETED 0x9000 |
DiegoOstuni | 0:de13951f30f6 | 42 | |
DiegoOstuni | 0:de13951f30f6 | 43 | #ifndef errorchk |
DiegoOstuni | 0:de13951f30f6 | 44 | #define errorchk(fCall) if (status = (fCall), status != NDEF_ACTION_COMPLETED) \ |
DiegoOstuni | 0:de13951f30f6 | 45 | {goto Error;} else |
DiegoOstuni | 0:de13951f30f6 | 46 | #endif |
DiegoOstuni | 0:de13951f30f6 | 47 | |
DiegoOstuni | 0:de13951f30f6 | 48 | /* Error codes for Higher level */ |
DiegoOstuni | 0:de13951f30f6 | 49 | #define NDEF_OK RESULTOK |
DiegoOstuni | 0:de13951f30f6 | 50 | #define NDEF_ERROR ERRORCODE_GENERIC |
DiegoOstuni | 0:de13951f30f6 | 51 | #define NDEF_ERROR_MEMORY_TAG 2 |
DiegoOstuni | 0:de13951f30f6 | 52 | #define NDEF_ERROR_MEMORY_INTERNAL 3 |
DiegoOstuni | 0:de13951f30f6 | 53 | #define NDEF_ERROR_LOCKED 4 |
DiegoOstuni | 0:de13951f30f6 | 54 | #define NDEF_ERROR_NOT_FORMATED 5 |
DiegoOstuni | 0:de13951f30f6 | 55 | |
DiegoOstuni | 0:de13951f30f6 | 56 | //#define NDEF_MAX_SIZE NFC_DEVICE_MAX_NDEFMEMORY |
DiegoOstuni | 0:de13951f30f6 | 57 | //#define NDEF_RECORD_MAX_SIZE (512) |
DiegoOstuni | 0:de13951f30f6 | 58 | #define NDEF_MAX_SIZE (100) |
DiegoOstuni | 0:de13951f30f6 | 59 | #define NDEF_RECORD_MAX_SIZE (100) |
DiegoOstuni | 0:de13951f30f6 | 60 | |
DiegoOstuni | 0:de13951f30f6 | 61 | #define NDEF_SIZE_OFFSET 0 |
DiegoOstuni | 0:de13951f30f6 | 62 | #define FIRST_RECORD_OFFSET 0 |
DiegoOstuni | 0:de13951f30f6 | 63 | |
DiegoOstuni | 0:de13951f30f6 | 64 | #define RECORD_FLAG_FIELD 1 |
DiegoOstuni | 0:de13951f30f6 | 65 | #define TYPE_LENGTH_FIELD 1 |
DiegoOstuni | 0:de13951f30f6 | 66 | #define ID_LENGTH_FIELD 1 |
DiegoOstuni | 0:de13951f30f6 | 67 | |
DiegoOstuni | 0:de13951f30f6 | 68 | |
DiegoOstuni | 0:de13951f30f6 | 69 | #define MB_Mask ((uint8_t)(0x80)) |
DiegoOstuni | 0:de13951f30f6 | 70 | #define ME_Mask ((uint8_t)(0x40)) |
DiegoOstuni | 0:de13951f30f6 | 71 | #define CF_Mask ((uint8_t)(0x20)) |
DiegoOstuni | 0:de13951f30f6 | 72 | #define SR_Mask ((uint8_t)(0x10)) |
DiegoOstuni | 0:de13951f30f6 | 73 | #define IL_Mask ((uint8_t)(0x08)) |
DiegoOstuni | 0:de13951f30f6 | 74 | #define TNF_Mask ((uint8_t)(0x07)) |
DiegoOstuni | 0:de13951f30f6 | 75 | |
DiegoOstuni | 0:de13951f30f6 | 76 | #define TNF_Empty 0x00 |
DiegoOstuni | 0:de13951f30f6 | 77 | #define TNF_WellKnown 0x01 |
DiegoOstuni | 0:de13951f30f6 | 78 | #define TNF_MediaType 0x02 |
DiegoOstuni | 0:de13951f30f6 | 79 | #define TNF_AbsoluteURI 0x03 |
DiegoOstuni | 0:de13951f30f6 | 80 | #define TNF_NFCForumExternal 0x04 |
DiegoOstuni | 0:de13951f30f6 | 81 | #define TNF_Unknown 0x05 |
DiegoOstuni | 0:de13951f30f6 | 82 | #define TNF_Unchanged 0x06 |
DiegoOstuni | 0:de13951f30f6 | 83 | #define TNF_Reserved 0x07 |
DiegoOstuni | 0:de13951f30f6 | 84 | |
DiegoOstuni | 0:de13951f30f6 | 85 | #define SP_MAX_RECORD 4 |
DiegoOstuni | 0:de13951f30f6 | 86 | |
DiegoOstuni | 0:de13951f30f6 | 87 | #define AAR_TYPE_STRING "android.com:pkg" |
DiegoOstuni | 0:de13951f30f6 | 88 | #define AAR_TYPE_STRING_LENGTH 15 |
DiegoOstuni | 0:de13951f30f6 | 89 | |
DiegoOstuni | 0:de13951f30f6 | 90 | #define M24SR_DISCOVERY_APP_STRING "st.com:m24sr_discovery_democtrl" |
DiegoOstuni | 0:de13951f30f6 | 91 | #define M24SR_DISCOVERY_APP_STRING_LENGTH 31 |
DiegoOstuni | 0:de13951f30f6 | 92 | |
DiegoOstuni | 0:de13951f30f6 | 93 | #define VCARD_TYPE_STRING "text/vcard" |
DiegoOstuni | 0:de13951f30f6 | 94 | #define VCARD_TYPE_STRING_LENGTH 10 |
DiegoOstuni | 0:de13951f30f6 | 95 | |
DiegoOstuni | 0:de13951f30f6 | 96 | #define XVCARD_TYPE_STRING "text/x-vCard" |
DiegoOstuni | 0:de13951f30f6 | 97 | #define XVCARD_TYPE_STRING_LENGTH 12 |
DiegoOstuni | 0:de13951f30f6 | 98 | |
DiegoOstuni | 0:de13951f30f6 | 99 | #define XVCARD2_TYPE_STRING "text/x-vcard" |
DiegoOstuni | 0:de13951f30f6 | 100 | #define XVCARD2_TYPE_STRING_LENGTH 12 |
DiegoOstuni | 0:de13951f30f6 | 101 | |
DiegoOstuni | 0:de13951f30f6 | 102 | #define SMART_POSTER_TYPE_STRING "Sp" |
DiegoOstuni | 0:de13951f30f6 | 103 | #define SMART_POSTER_TYPE_STRING_LENGTH 2 |
DiegoOstuni | 0:de13951f30f6 | 104 | |
DiegoOstuni | 0:de13951f30f6 | 105 | #define URI_TYPE_STRING "U" |
DiegoOstuni | 0:de13951f30f6 | 106 | #define URI_TYPE_STRING_LENGTH 1 |
DiegoOstuni | 0:de13951f30f6 | 107 | |
DiegoOstuni | 0:de13951f30f6 | 108 | #define SMS_TYPE_STRING "sms:" |
DiegoOstuni | 0:de13951f30f6 | 109 | #define SMS_TYPE_STRING_LENGTH 4 |
DiegoOstuni | 0:de13951f30f6 | 110 | |
DiegoOstuni | 0:de13951f30f6 | 111 | #define GEO_TYPE_STRING "geo:" |
DiegoOstuni | 0:de13951f30f6 | 112 | #define GEO_TYPE_STRING_LENGTH 4 |
DiegoOstuni | 0:de13951f30f6 | 113 | |
DiegoOstuni | 0:de13951f30f6 | 114 | #define URI_LATITUDE_END "," |
DiegoOstuni | 0:de13951f30f6 | 115 | #define URI_LATITUDE_END_LENGTH 1 |
DiegoOstuni | 0:de13951f30f6 | 116 | |
DiegoOstuni | 0:de13951f30f6 | 117 | #define EMAIL_TYPE_STRING "mailto:" |
DiegoOstuni | 0:de13951f30f6 | 118 | #define EMAIL_TYPE_STRING_LENGTH 7 |
DiegoOstuni | 0:de13951f30f6 | 119 | |
DiegoOstuni | 0:de13951f30f6 | 120 | #define URI_FIRST_DATA_END "?" |
DiegoOstuni | 0:de13951f30f6 | 121 | #define URI_FIRST_DATA_END_LENGTH 1 |
DiegoOstuni | 0:de13951f30f6 | 122 | |
DiegoOstuni | 0:de13951f30f6 | 123 | #define SUBJECT_BEGIN_STRING "subject=" |
DiegoOstuni | 0:de13951f30f6 | 124 | #define SUBJECT_BEGIN_STRING_LENGTH 8 |
DiegoOstuni | 0:de13951f30f6 | 125 | |
DiegoOstuni | 0:de13951f30f6 | 126 | #define MESSAGE_BEGIN_STRING "body=" |
DiegoOstuni | 0:de13951f30f6 | 127 | #define MESSAGE_BEGIN_STRING_LENGTH 5 |
DiegoOstuni | 0:de13951f30f6 | 128 | |
DiegoOstuni | 0:de13951f30f6 | 129 | #define URI_SECOND_DATA_END "&" |
DiegoOstuni | 0:de13951f30f6 | 130 | #define URI_SECOND_DATA_END_LENGTH 1 |
DiegoOstuni | 0:de13951f30f6 | 131 | |
DiegoOstuni | 0:de13951f30f6 | 132 | #define TEXT_TYPE_STRING "T" |
DiegoOstuni | 0:de13951f30f6 | 133 | #define TEXT_TYPE_STRING_LENGTH 1 |
DiegoOstuni | 0:de13951f30f6 | 134 | |
DiegoOstuni | 0:de13951f30f6 | 135 | #define ISO_ENGLISH_CODE_STRING "en" |
DiegoOstuni | 0:de13951f30f6 | 136 | #define ISO_ENGLISH_CODE_STRING_LENGTH 2 |
DiegoOstuni | 0:de13951f30f6 | 137 | |
DiegoOstuni | 0:de13951f30f6 | 138 | |
DiegoOstuni | 0:de13951f30f6 | 139 | #define URI_ID_0x00 0x00 |
DiegoOstuni | 0:de13951f30f6 | 140 | #define URI_ID_0x01 0x01 |
DiegoOstuni | 0:de13951f30f6 | 141 | #define URI_ID_0x02 0x02 |
DiegoOstuni | 0:de13951f30f6 | 142 | #define URI_ID_0x03 0x03 |
DiegoOstuni | 0:de13951f30f6 | 143 | #define URI_ID_0x04 0x04 |
DiegoOstuni | 0:de13951f30f6 | 144 | #define URI_ID_0x05 0x05 |
DiegoOstuni | 0:de13951f30f6 | 145 | #define URI_ID_0x06 0x06 |
DiegoOstuni | 0:de13951f30f6 | 146 | #define URI_ID_0x07 0x07 |
DiegoOstuni | 0:de13951f30f6 | 147 | #define URI_ID_0x08 0x08 |
DiegoOstuni | 0:de13951f30f6 | 148 | #define URI_ID_0x09 0x09 |
DiegoOstuni | 0:de13951f30f6 | 149 | #define URI_ID_0x0A 0x0A |
DiegoOstuni | 0:de13951f30f6 | 150 | #define URI_ID_0x0B 0x0B |
DiegoOstuni | 0:de13951f30f6 | 151 | #define URI_ID_0x0C 0x0C |
DiegoOstuni | 0:de13951f30f6 | 152 | #define URI_ID_0x0D 0x0D |
DiegoOstuni | 0:de13951f30f6 | 153 | #define URI_ID_0x0E 0x0E |
DiegoOstuni | 0:de13951f30f6 | 154 | #define URI_ID_0x0F 0x0F |
DiegoOstuni | 0:de13951f30f6 | 155 | #define URI_ID_0x10 0x10 |
DiegoOstuni | 0:de13951f30f6 | 156 | #define URI_ID_0x11 0x11 |
DiegoOstuni | 0:de13951f30f6 | 157 | #define URI_ID_0x12 0x12 |
DiegoOstuni | 0:de13951f30f6 | 158 | #define URI_ID_0x13 0x13 |
DiegoOstuni | 0:de13951f30f6 | 159 | #define URI_ID_0x14 0x14 |
DiegoOstuni | 0:de13951f30f6 | 160 | #define URI_ID_0x15 0x15 |
DiegoOstuni | 0:de13951f30f6 | 161 | #define URI_ID_0x16 0x16 |
DiegoOstuni | 0:de13951f30f6 | 162 | #define URI_ID_0x17 0x17 |
DiegoOstuni | 0:de13951f30f6 | 163 | #define URI_ID_0x18 0x18 |
DiegoOstuni | 0:de13951f30f6 | 164 | #define URI_ID_0x19 0x19 |
DiegoOstuni | 0:de13951f30f6 | 165 | #define URI_ID_0x1A 0x1A |
DiegoOstuni | 0:de13951f30f6 | 166 | #define URI_ID_0x1B 0x1B |
DiegoOstuni | 0:de13951f30f6 | 167 | #define URI_ID_0x1C 0x1C |
DiegoOstuni | 0:de13951f30f6 | 168 | #define URI_ID_0x1D 0x1D |
DiegoOstuni | 0:de13951f30f6 | 169 | #define URI_ID_0x1E 0x1E |
DiegoOstuni | 0:de13951f30f6 | 170 | #define URI_ID_0x1F 0x1F |
DiegoOstuni | 0:de13951f30f6 | 171 | #define URI_ID_0x20 0x20 |
DiegoOstuni | 0:de13951f30f6 | 172 | #define URI_ID_0x21 0x21 |
DiegoOstuni | 0:de13951f30f6 | 173 | #define URI_ID_0x22 0x22 |
DiegoOstuni | 0:de13951f30f6 | 174 | #define URI_ID_0x23 0x23 |
DiegoOstuni | 0:de13951f30f6 | 175 | #define URI_RFU 0x24 |
DiegoOstuni | 0:de13951f30f6 | 176 | |
DiegoOstuni | 0:de13951f30f6 | 177 | #define URI_ID_0x01_STRING "http://www.\0" |
DiegoOstuni | 0:de13951f30f6 | 178 | #define URI_ID_0x02_STRING "https://www.\0" |
DiegoOstuni | 0:de13951f30f6 | 179 | #define URI_ID_0x03_STRING "http://\0" |
DiegoOstuni | 0:de13951f30f6 | 180 | #define URI_ID_0x04_STRING "https://\0" |
DiegoOstuni | 0:de13951f30f6 | 181 | #define URI_ID_0x05_STRING "tel:\0" |
DiegoOstuni | 0:de13951f30f6 | 182 | #define URI_ID_0x06_STRING "mailto:\0" |
DiegoOstuni | 0:de13951f30f6 | 183 | #define URI_ID_0x07_STRING "ftp://anonymous:anonymous@\0" |
DiegoOstuni | 0:de13951f30f6 | 184 | #define URI_ID_0x08_STRING "ftp://ftp.\0" |
DiegoOstuni | 0:de13951f30f6 | 185 | #define URI_ID_0x09_STRING "ftps://\0" |
DiegoOstuni | 0:de13951f30f6 | 186 | #define URI_ID_0x0A_STRING "sftp://\0" |
DiegoOstuni | 0:de13951f30f6 | 187 | #define URI_ID_0x0B_STRING "smb://\0" |
DiegoOstuni | 0:de13951f30f6 | 188 | #define URI_ID_0x0C_STRING "nfs://\0" |
DiegoOstuni | 0:de13951f30f6 | 189 | #define URI_ID_0x0D_STRING "ftp://\0" |
DiegoOstuni | 0:de13951f30f6 | 190 | #define URI_ID_0x0E_STRING "dav://\0" |
DiegoOstuni | 0:de13951f30f6 | 191 | #define URI_ID_0x0F_STRING "news:\0" |
DiegoOstuni | 0:de13951f30f6 | 192 | #define URI_ID_0x10_STRING "telnet://\0" |
DiegoOstuni | 0:de13951f30f6 | 193 | #define URI_ID_0x11_STRING "imap:\0" |
DiegoOstuni | 0:de13951f30f6 | 194 | #define URI_ID_0x12_STRING "rtsp://\0" |
DiegoOstuni | 0:de13951f30f6 | 195 | #define URI_ID_0x13_STRING "urn:\0" |
DiegoOstuni | 0:de13951f30f6 | 196 | #define URI_ID_0x14_STRING "pop:\0" |
DiegoOstuni | 0:de13951f30f6 | 197 | #define URI_ID_0x15_STRING "sip:\0" |
DiegoOstuni | 0:de13951f30f6 | 198 | #define URI_ID_0x16_STRING "sips:\0" |
DiegoOstuni | 0:de13951f30f6 | 199 | #define URI_ID_0x17_STRING "tftp:\0" |
DiegoOstuni | 0:de13951f30f6 | 200 | #define URI_ID_0x18_STRING "btspp://\0" |
DiegoOstuni | 0:de13951f30f6 | 201 | #define URI_ID_0x19_STRING "btl2cap://\0" |
DiegoOstuni | 0:de13951f30f6 | 202 | #define URI_ID_0x1A_STRING "btgoep://\0" |
DiegoOstuni | 0:de13951f30f6 | 203 | #define URI_ID_0x1B_STRING "tcpobex://\0" |
DiegoOstuni | 0:de13951f30f6 | 204 | #define URI_ID_0x1C_STRING "irdaobex://\0" |
DiegoOstuni | 0:de13951f30f6 | 205 | #define URI_ID_0x1D_STRING "file://\0" |
DiegoOstuni | 0:de13951f30f6 | 206 | #define URI_ID_0x1E_STRING "urn:epc:id:\0" |
DiegoOstuni | 0:de13951f30f6 | 207 | #define URI_ID_0x1F_STRING "urn:epc:tag\0" |
DiegoOstuni | 0:de13951f30f6 | 208 | #define URI_ID_0x20_STRING "urn:epc:pat:\0" |
DiegoOstuni | 0:de13951f30f6 | 209 | #define URI_ID_0x21_STRING "urn:epc:raw:\0" |
DiegoOstuni | 0:de13951f30f6 | 210 | #define URI_ID_0x22_STRING "urn:epc:\0" |
DiegoOstuni | 0:de13951f30f6 | 211 | #define URI_ID_0x23_STRING "urn:nfc:\0" |
DiegoOstuni | 0:de13951f30f6 | 212 | |
DiegoOstuni | 0:de13951f30f6 | 213 | // exported variables |
DiegoOstuni | 0:de13951f30f6 | 214 | extern uint8_t NDEF_Buffer[NDEF_MAX_SIZE]; |
DiegoOstuni | 0:de13951f30f6 | 215 | extern uint32_t NDEF_Buffer_size; |
DiegoOstuni | 0:de13951f30f6 | 216 | extern uint8_t NDEF_Record_Buffer [NDEF_RECORD_MAX_SIZE]; |
DiegoOstuni | 0:de13951f30f6 | 217 | extern uint32_t NDEF_Record_Buffer_size; |
DiegoOstuni | 0:de13951f30f6 | 218 | |
DiegoOstuni | 0:de13951f30f6 | 219 | typedef enum |
DiegoOstuni | 0:de13951f30f6 | 220 | { |
DiegoOstuni | 0:de13951f30f6 | 221 | UNKNOWN_TYPE = 0, |
DiegoOstuni | 0:de13951f30f6 | 222 | VCARD_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 223 | WELL_KNOWN_ABRIDGED_URI_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 224 | URI_SMS_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 225 | URI_GEO_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 226 | URI_EMAIL_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 227 | SMARTPOSTER_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 228 | URL_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 229 | TEXT_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 230 | HANDOVER_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 231 | /* list of "external type" known by this demo, other external type will be addressed as UNKNWON_TYPE */ |
DiegoOstuni | 0:de13951f30f6 | 232 | M24SR_DISCOVERY_APP_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 233 | BT_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 234 | BLE_TYPE, |
DiegoOstuni | 0:de13951f30f6 | 235 | URI_WIFITOKEN_TYPE |
DiegoOstuni | 0:de13951f30f6 | 236 | } NDEF_TypeDef; |
DiegoOstuni | 0:de13951f30f6 | 237 | |
DiegoOstuni | 0:de13951f30f6 | 238 | typedef struct sRecordInfo sRecordInfo_t; |
DiegoOstuni | 0:de13951f30f6 | 239 | |
DiegoOstuni | 0:de13951f30f6 | 240 | struct sRecordInfo |
DiegoOstuni | 0:de13951f30f6 | 241 | { |
DiegoOstuni | 0:de13951f30f6 | 242 | uint8_t RecordFlags; |
DiegoOstuni | 0:de13951f30f6 | 243 | uint8_t TypeLength; |
DiegoOstuni | 0:de13951f30f6 | 244 | uint32_t PayloadLength; |
DiegoOstuni | 0:de13951f30f6 | 245 | uint8_t IDLength; |
DiegoOstuni | 0:de13951f30f6 | 246 | uint8_t Type[20]; |
DiegoOstuni | 0:de13951f30f6 | 247 | uint8_t ID[20]; |
DiegoOstuni | 0:de13951f30f6 | 248 | uint16_t PayloadOffset; |
DiegoOstuni | 0:de13951f30f6 | 249 | uint8_t* PayloadBufferAdd; /* add where payload content has been stored */ |
DiegoOstuni | 0:de13951f30f6 | 250 | NDEF_TypeDef NDEF_Type; /* to store identification ID for application */ |
DiegoOstuni | 0:de13951f30f6 | 251 | sRecordInfo_t *SPRecordStructAdd[SP_MAX_RECORD]; /*in case of smart poster array to store add of other sRecordInfo struct */ |
DiegoOstuni | 0:de13951f30f6 | 252 | uint8_t NbOfRecordInSPPayload; |
DiegoOstuni | 0:de13951f30f6 | 253 | }; |
DiegoOstuni | 0:de13951f30f6 | 254 | |
DiegoOstuni | 0:de13951f30f6 | 255 | uint16_t NDEF_IdentifyNDEF( sRecordInfo_t *pRecordStruct, uint8_t* pNDEF, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 256 | uint16_t NDEF_IdentifyBuffer( sRecordInfo_t *pRecordStruct, uint8_t* pNDEF ); |
DiegoOstuni | 0:de13951f30f6 | 257 | uint16_t NDEF_ReadNDEF( uint8_t *pNDEF, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 258 | uint16_t NDEF_WriteNDEF( uint16_t NDEF_Size, uint8_t *pNDEF, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 259 | uint16_t NDEF_ClearNDEF(I2C* mi2cChannel); |
DiegoOstuni | 0:de13951f30f6 | 260 | uint16_t NDEF_getNDEFSize(uint16_t* Size, I2C* mi2cChannel); |
DiegoOstuni | 0:de13951f30f6 | 261 | uint32_t NDEF_WriteRecord( sRecordInfo_t *pRecord, uint8_t* pNDEF, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 262 | uint16_t NDEF_AppendRecord(sRecordInfo_t *Record, I2C* mi2cChannel ); |
DiegoOstuni | 0:de13951f30f6 | 263 | uint32_t NDEF_GetRecordLength( sRecordInfo_t *pRecord ); |
DiegoOstuni | 0:de13951f30f6 | 264 | |
DiegoOstuni | 0:de13951f30f6 | 265 | #endif /* __LIB_NDEF_H */ |
DiegoOstuni | 0:de13951f30f6 | 266 | |
DiegoOstuni | 0:de13951f30f6 | 267 | |
DiegoOstuni | 0:de13951f30f6 | 268 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |