Lines Matching refs:NdefReg
80 NFCSTATUS phFriNfc_NdefReg_Reset(phFriNfc_NdefReg_t *NdefReg,
91 if(NdefReg == NULL || NdefTypesarray == NULL || RecordsExtracted == NULL || CbParam == NULL)
97 NdefReg->State=PH_FRINFC_NDEFREG_STATE_INIT;
98 NdefReg->NdefData=NULL;
99 NdefReg->NdefDataLength=0;
100 NdefReg->NdefTypeList=NULL;
101 NdefReg->NdefTypes = NdefTypesarray ;
102 NdefReg->RecordsExtracted = RecordsExtracted;
103 NdefReg->CbParam = CbParam;
104 NdefReg->validPreviousTnf = 0xff;
105 NdefReg->IsChunked = ChunkedRecordsarray;
106 NdefReg->NumberOfRecords = NumberOfRecords;
107 NdefReg->newRecordextracted = 0;
108 NdefReg->MainTnfFound = 0;
115 NFCSTATUS phFriNfc_NdefReg_AddCb(phFriNfc_NdefReg_t *NdefReg,
120 if( NdefReg == NULL || NdefCb ==NULL)
131 if(NdefReg->NdefTypeList==NULL)
135 NdefReg->NdefTypeList = NdefCb;
141 NdefCb->Next = NdefReg->NdefTypeList;
143 NdefReg->NdefTypeList->Previous = NdefCb;
144 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
162 NFCSTATUS phFriNfc_NdefReg_RmCb(phFriNfc_NdefReg_t *NdefReg,
169 if( NdefReg==NULL || NdefCb ==NULL)
175 tempNode = NdefReg->NdefTypeList;
177 if(NdefReg->NdefTypeList == NULL)
190 update the NdefReg->NdefTypeList pointer */
193 NdefReg->NdefTypeList =NdefReg->NdefTypeList->Next;
194 NdefReg->NdefTypeList->Previous = NULL;
200 NdefReg->NdefTypeList=NULL;
229 NFCSTATUS phFriNfc_NdefReg_DispatchPacket(phFriNfc_NdefReg_t *NdefReg,
235 if(NdefReg==NULL ||PacketData==NULL || PacketDataLength==0)
241 NdefReg->NdefData = PacketData;
242 NdefReg->NdefDataLength = PacketDataLength;
243 NdefReg->State = PH_FRINFC_NDEFREG_STATE_DIS_PKT;
244 NdefReg->NumberOfNdefTypes = 0;
245 NdefReg->RecordIndex = 0;
246 NdefReg->RtdIndex = 0;
254 NFCSTATUS phFriNfc_NdefReg_DispatchRecord(phFriNfc_NdefReg_t *NdefReg,
258 if(NdefReg==NULL || RecordsExtracted==NULL)
264 NdefReg->RecordsExtracted = RecordsExtracted;
265 NdefReg->State = PH_FRINFC_NDEFREG_STATE_DIS_RCD;
272 uint8_t phFriNfc_NdefReg_Process(phFriNfc_NdefReg_t *NdefReg,
283 if(NdefReg->NdefTypeList == NULL)
291 switch(NdefReg->State)
295 /* for START ( each node in the list NdefReg->NdefTypeList), do the following */
296 for(index=0;index<NdefReg->NdefTypeList->NumberOfRTDs;index++)
299 if( (NdefReg->NdefTypeList->Tnf[index] & PH_FRINFC_NDEFRECORD_TNF_MASK ) ==
300 (NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) )
303 if( NdefReg->NdefTypeList->NdeftypeLength[index] == \
304 NdefReg->RecordsExtracted->TypeLength )
308 switch(NdefReg->NdefTypeList->Tnf[index])
313 if( !phFriNfc_NdefReg_Strncmp( (const int8_t *)NdefReg->NdefTypeList->NdefType[index] ,
314 (const int8_t *)(NdefReg->RecordsExtracted->Type),
315 NdefReg->RecordsExtracted->TypeLength))
330 if( !phFriNfc_NdefReg_Strnicmp( (int8_t *)NdefReg->NdefTypeList->NdefType[index] ,
331 (int8_t *)(NdefReg->RecordsExtracted->Type),
332 NdefReg->RecordsExtracted->TypeLength))
352 NdefReg->CbParam->Chunked[count] = (NdefReg->RecordsExtracted->Flags & \
360 (void) memcpy( &NdefReg->CbParam->Records[count],
361 NdefReg->RecordsExtracted,
370 in this particular node NdefReg->NdefTypeList.
374 NdefReg->CbParam->Count = count;
375 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
376 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
380 NdefReg->CbParam->Count = 0;
383 /* for END ( each node in the list NdefReg->NdefTypeList), do the following */
384 if(NdefReg->NdefTypeList->Next==NULL)
386 NdefReg->State = PH_FRINFC_NDEFREG_STATE_INIT;
387 while(NdefReg->NdefTypeList->Previous!=NULL)
389 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
397 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Next;
405 if(NdefReg->NumberOfNdefTypes == 0)
407 /* First, Get all the records present in the data packet NdefReg->NdefData
410 *Status = phFriNfc_NdefRecord_GetRecords( NdefReg->NdefData,
411 NdefReg->NdefDataLength,
413 NdefReg->IsChunked,
414 &NdefReg->NumberOfNdefTypes);
419 NdefReg->NumberOfNdefTypes = 0;
423 if(NdefReg->NumberOfNdefTypes > NdefReg->NumberOfRecords)
425 /* There is not enough space in the arrays NdefReg->NdefTypes
426 and NdefReg->IsChunked, to write NdefReg->NumberOfRecords
430 NdefReg->NumberOfNdefTypes = 0;
435 *Status = phFriNfc_NdefRecord_GetRecords( NdefReg->NdefData,
436 NdefReg->NdefDataLength,
437 NdefReg->NdefTypes,
438 NdefReg->IsChunked,
439 &NdefReg->NumberOfNdefTypes);
444 NdefReg->NumberOfNdefTypes = 0;
449 /* For each record, in the arry NdefReg->NdefTypes, check
458 while(NdefReg->RecordIndex < NdefReg->NumberOfNdefTypes)
461 *Status = phFriNfc_NdefRecord_Parse(NdefReg->RecordsExtracted,
462 NdefReg->NdefTypes[NdefReg->RecordIndex]);
466 NdefReg->NumberOfNdefTypes = 0;
470 NdefReg->newRecordextracted = 1;
473 while(NdefReg->RtdIndex < NdefReg->NdefTypeList->NumberOfRTDs)
481 if((NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) ==
484 if(NdefReg->MainTnfFound == 1)
492 if(NdefReg->newRecordextracted)
494 NdefReg->MainTnfFound = 0;
498 NdefReg->validPreviousTnf = NdefReg->RecordsExtracted->Tnf;
503 if((NdefReg->NdefTypeList->Tnf[NdefReg->RtdIndex] &
505 (NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) &&
506 (NdefReg->NdefTypeList->NdeftypeLength[NdefReg->RtdIndex] ==
507 NdefReg->RecordsExtracted->TypeLength))
510 switch(NdefReg->NdefTypeList->Tnf[NdefReg->RtdIndex])
515 if(!phFriNfc_NdefReg_Strncmp((const int8_t *)NdefReg->NdefTypeList->NdefType[NdefReg->RtdIndex],
516 (const int8_t *)(NdefReg->RecordsExtracted->Type),
517 NdefReg->RecordsExtracted->TypeLength))
532 if( !phFriNfc_NdefReg_Strnicmp( (int8_t *)NdefReg->NdefTypeList->NdefType[NdefReg->RtdIndex],
533 (int8_t *)(NdefReg->RecordsExtracted->Type),
534 NdefReg->RecordsExtracted->TypeLength))
554 NdefReg->MainTnfFound = 1;
571 NdefReg->CbParam->Chunked[count] = NdefReg->IsChunked[NdefReg->RecordIndex];
574 NdefReg->CbParam->RawRecord[count] = NdefReg->NdefTypes[NdefReg->RecordIndex];
577 NdefReg->CbParam->RawRecordSize[count] = phFriNfc_NdefRecord_GetLength(NdefReg->RecordsExtracted);
581 (void) memcpy( &NdefReg->CbParam->Records[count],
582 NdefReg->RecordsExtracted,
595 NdefReg->CbParam->Count = count;
596 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
597 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
600 NdefReg->RecordIndex++;
607 if((NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK )
615 NdefReg->RtdIndex++;
617 NdefReg->newRecordextracted = 0;
619 while(NdefReg->RtdIndex < NdefReg->NdefTypeList->NumberOfRTDs) */
623 NdefReg->RtdIndex = 0;
624 NdefReg->RecordIndex++;
625 } /* while(NdefReg->RecordIndex<NdefReg->NumberOfNdefTypes) */
631 NdefReg->CbParam->Count = count;
632 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
633 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
637 NdefReg->CbParam->Count = 0;
640 if(NdefReg->NdefTypeList->Next==NULL)
643 NdefReg->State = PH_FRINFC_NDEFREG_STATE_INIT;
644 while(NdefReg->NdefTypeList->Previous!=NULL)
646 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
655 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Next;
661 NdefReg->RecordIndex = 0;
662 NdefReg->RtdIndex = 0;