2 #define LOG_TAG "mocklibnci"
23 uint8_t rec_hdr = 0x00;
32 strOUT[2] = sizLen + offset;
36 strncat((
char*) strOUT, (
const char*) strIN, sizLen);
55 strOUT[2] = sizLen + offset;
65 strncat((
char*) strOUT, (
const char*) strIN, sizLen);
85 strOUT[2] = sizLen + offset + 10;
95 strncat((
char*) strOUT, (
const char*) strIN, sizLen);
97 strOUT[sizehdr + offset + sizLen + 0] = 0x51;
98 strOUT[sizehdr + offset + sizLen + 1] = 0x01;
99 strOUT[sizehdr + offset + sizLen + 2] = 0x07;
100 strOUT[sizehdr + offset + sizLen + 3] = 0x54;
101 strOUT[sizehdr + offset + sizLen + 4] = 0x02;
102 strOUT[sizehdr + offset + sizLen + 5] = 0x66;
103 strOUT[sizehdr + offset + sizLen + 6] = 0x72;
104 strOUT[sizehdr + offset + sizLen + 7] = 0x42;
105 strOUT[sizehdr + offset + sizLen + 8] = 0x6C;
106 strOUT[sizehdr + offset + sizLen + 9] = 0x6F;
107 strOUT[sizehdr + offset + sizLen + 10] = 0x67;
117 for (ii = 0; ii <= sizLen + offset; ii++)
118 strOUT[ii + offset] = strIN[ii];
124 #define NCI_MSG_RF_INTF_ACTIVATED 5
135 for (ii = 0; ii <= sizLen + offset; ii++)
136 strOUT[ii + offset] = strIN[ii];
145 int codeNFC(NfcPayload* nfcData, uint8_t* msg)
147 int Type = nfcData->type;
148 int Lang = nfcData->lang;
150 int argLen = strlen(nfcData->text);
151 int offsetPrefix = 1;
155 LOGM(
"codeNFC - %d %d %s %s", nfcData->type, nfcData->lang, nfcData->text, nfcData->tittle);
160 sizehdr += offsetPrefix;
161 msg_len = (argLen + sizehdr);
171 sizehdr += offsetPrefix;
172 msg_len = (argLen + sizehdr);
179 sizehdr += offsetPrefix;
180 msg_len = (argLen + sizehdr);
188 sizehdr += offsetPrefix;
189 msg_len = (argLen + sizehdr) + 11;
192 (
unsigned char*) nfcData->tittle, argLen, msg);
196 msg_len = (argLen + sizehdr);
217 uint8_t rec_hdr, type_len;
236 *p_type_len = type_len;
256 uint8_t rec_hdr, type_len;
272 *p_id_len = *p_rec++;
280 return (p_rec + type_len);
294 uint8_t rec_hdr, type_len, id_len;
295 uint32_t payload_len;
305 payload_len = *p_rec++;
309 *p_payload_len = payload_len;
318 if (payload_len == 0)
321 return (p_rec + type_len + id_len);
335 uint8_t* p_rec = p_msg;
336 uint8_t* p_end = p_msg + msg_len;
337 uint8_t rec_hdr = 0, type_len, id_len;
339 uint32_t payload_len;
340 int bInChunk =
FALSE;
342 if ((p_msg == NULL) || (msg_len < 3))
353 for (count = 0; p_rec < p_end; count++)
356 if (p_rec + 3 > p_end)
362 if ((count > 0) && (rec_hdr & NDEF_MB_MASK))
370 payload_len = *p_rec++;
374 if (p_rec + 4 > p_end)
384 if (p_rec + 1 > p_end)
401 if ((type_len != 0) || (id_len != 0) ||
419 if ((type_len != 0) || (id_len != 0) ||
436 if ((type_len != 0) || (id_len != 0) || (payload_len != 0))
447 p_rec += (payload_len + type_len + id_len);
void createBufNdef_TypeText(uint8_t *strIN, int sizLen, uint8_t *strOUT)
tNDEF_STATUS NDEF_MsgValidate(uint8_t *p_msg, uint32_t msg_len, int b_allow_chunks)
uint8_t * NDEF_RecGetPayload(uint8_t *p_rec, uint32_t *p_payload_len)
uint8_t * NDEF_RecGetId(uint8_t *p_rec, uint8_t *p_id_len)
void createBufNdef_TypeURI(uint8_t *strIN, int sizLen, uint8_t *strOUT)
#define NCI_GID_RF_MANAGE
#define NCI_MSG_BLD_HDR0(p, mt, gid)
#define BE_STREAM_TO_uint32_t(u32, p)
void vshort_sendata(uint8_t *strIN, int sizLen, uint8_t *strOUT)
int codeNFC(NfcPayload *nfcData, uint8_t *msg)
#define NCI_MSG_RF_INTF_ACTIVATED
void createBufNdef_TypeSmartPoster(uint8_t *strIN, uint8_t *strIN2, int sizLen, uint8_t *strOUT)
#define NDEF_TNF_UNCHANGED
#define LOGM(...)
Log at MESSAGE level.
#define NCI_MSG_BLD_HDR1(p, oid)
uint8_t * NDEF_RecGetType(uint8_t *p_rec, uint8_t *p_tnf, uint8_t *p_type_len)
void vshort_actidata(uint8_t *strIN, int sizLen, uint8_t *strOUT)
#define NCI_DATA_BLD_HDR(p, cid, len)