2 * Copyright (C) 2010 NXP Semiconductors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 * \file phFriNfc_NdefReg.c
\r
19 * \Contains Registry and module functions.
\r
23 * $Date: Mon May 25 13:59:32 2009 $
\r
24 * $Author: ing08150 $
\r
26 * $Aliases: NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
\r
31 #include "phNfcTypes.h"
\r
32 #include "phNfcStatus.h"
\r
33 #include "phNfcCompId.h"
\r
34 #include "phNfcHalTypes.h"
\r
35 #include "phFriNfc.h"
\r
36 #include "phFriNfc_NdefReg.h"
\r
37 #include "phFriNfc_NdefRecord.h"
\r
39 /* Harsha: To Fix: 0000358: phFriNfc_NdefRecord.h: includes should be moved */
\r
41 static int16_t phFriNfc_NdefReg_Strncmp (const int8_t *s1, const int8_t *s2, uint32_t count);
\r
43 /********* String functions *********/
\r
45 static int16_t phFriNfc_NdefReg_Strncmp (const int8_t *s1, const int8_t *s2, uint32_t count)
\r
47 return (int16_t)strncmp((const char*)s1,(const char*)s2, count);
\r
49 int16_t phFriNfc_NdefReg_Strnicmp(const int8_t *s1, const int8_t *s2, uint32_t count)
\r
52 int16_t returnvalue;
\r
65 while ( (c1 == c2) && (c1 != '\0') && (c2 != '\0') && (count > 0) );
\r
67 if ( (count == 0) || (c1 == c2) )
\r
70 else if ( (c1 > c2) )
\r
75 return(returnvalue);
\r
78 /********* REGISTRY AND LISTENER MODULE *********/
\r
80 NFCSTATUS phFriNfc_NdefReg_Reset(phFriNfc_NdefReg_t *NdefReg,
\r
81 uint8_t **NdefTypesarray,
\r
82 phFriNfc_NdefRecord_t *RecordsExtracted,
\r
83 phFriNfc_NdefReg_CbParam_t *CbParam,
\r
84 uint8_t *ChunkedRecordsarray,
\r
85 uint32_t NumberOfRecords)
\r
87 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
89 /* Reset/Initialise the values of the Context structure */
\r
90 /* Store the required pointers in the context structure */
\r
91 if(NdefReg == NULL || NdefTypesarray == NULL || RecordsExtracted == NULL || CbParam == NULL)
\r
93 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_PARAMETER);
\r
97 NdefReg->State=PH_FRINFC_NDEFREG_STATE_INIT;
\r
98 NdefReg->NdefData=NULL;
\r
99 NdefReg->NdefDataLength=0;
\r
100 NdefReg->NdefTypeList=NULL;
\r
101 NdefReg->NdefTypes = NdefTypesarray ;
\r
102 NdefReg->RecordsExtracted = RecordsExtracted;
\r
103 NdefReg->CbParam = CbParam;
\r
104 NdefReg->validPreviousTnf = 0xff;
\r
105 NdefReg->IsChunked = ChunkedRecordsarray;
\r
106 NdefReg->NumberOfRecords = NumberOfRecords;
\r
107 NdefReg->newRecordextracted = 0;
\r
108 NdefReg->MainTnfFound = 0;
\r
113 /* Adds a NDEF type listener to the internal list of listeners*/
\r
114 /*Libraray does no allocation of the memory*/
\r
115 NFCSTATUS phFriNfc_NdefReg_AddCb(phFriNfc_NdefReg_t *NdefReg,
\r
116 phFriNfc_NdefReg_Cb_t *NdefCb)
\r
118 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
120 if( NdefReg == NULL || NdefCb ==NULL)
\r
122 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_PARAMETER);
\r
126 /* Check whether we can accomodate all these records in a single node */
\r
127 if(NdefCb->NumberOfRTDs <= PH_FRINFC_NDEFREG_MAX_RTD_REGISTERED)
\r
129 /* Yes, all these Records can be accomodated in a single node */
\r
130 /* No existing node. This will be the first Node */
\r
131 if(NdefReg->NdefTypeList==NULL)
\r
133 NdefCb->Previous =NULL;
\r
134 NdefCb->Next =NULL;
\r
135 NdefReg->NdefTypeList = NdefCb;
\r
139 /* Some nodes are existing. Add the new CB node at the front
\r
140 of the List and update pointers */
\r
141 NdefCb->Next = NdefReg->NdefTypeList;
\r
142 NdefCb->Previous = NULL;
\r
143 NdefReg->NdefTypeList->Previous = NdefCb;
\r
144 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
\r
149 /* We cannot accomodate more records than PH_FRINFC_NDEFREG_MAX_RTD_REGISTERED
\r
151 So return warning NFCSTATUS_INVALID_PARAMETER. */
\r
152 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY,
\r
153 NFCSTATUS_INVALID_PARAMETER);
\r
160 /*Removes a specific listener from the list. The element to remove is specified by its address.*/
\r
161 /*Libraray does no deallocation of the memory*/
\r
162 NFCSTATUS phFriNfc_NdefReg_RmCb(phFriNfc_NdefReg_t *NdefReg,
\r
163 phFriNfc_NdefReg_Cb_t *NdefCb)
\r
165 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
166 phFriNfc_NdefReg_Cb_t *tempNode;
\r
167 uint8_t found=0;/* to check for the node present or not */
\r
169 if( NdefReg==NULL || NdefCb ==NULL)
\r
171 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_PARAMETER);
\r
175 tempNode = NdefReg->NdefTypeList;
\r
176 /* if the list is empty */
\r
177 if(NdefReg->NdefTypeList == NULL)
\r
179 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_NOT_REGISTERED);
\r
183 while(tempNode!=NULL)
\r
185 if(NdefCb == tempNode)
\r
187 found=1;/* if the node is present */
\r
189 /* node is present in the front of the list so
\r
190 update the NdefReg->NdefTypeList pointer */
\r
191 if(tempNode->Previous==NULL && tempNode->Next!=NULL)
\r
193 NdefReg->NdefTypeList =NdefReg->NdefTypeList->Next;
\r
194 NdefReg->NdefTypeList->Previous = NULL;
\r
197 /* only one node in the list so update the head node */
\r
198 if(tempNode->Next==NULL && tempNode->Previous==NULL)
\r
200 NdefReg->NdefTypeList=NULL;
\r
203 if (tempNode->Previous != NULL)
\r
205 tempNode->Previous->Next = tempNode->Next;
\r
207 if (tempNode->Next != NULL)
\r
209 tempNode->Next->Previous = tempNode->Previous;
\r
213 /* move to the next node */
\r
214 tempNode = tempNode->Next;
\r
219 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_NOT_REGISTERED);
\r
225 /* Copy the relevant pointers to the context structure, change the
\r
226 FSM state, so as to trigger the process and return pending. This function is non-blocking,
\r
227 it returns once the operation is initiated or an error occurs */
\r
229 NFCSTATUS phFriNfc_NdefReg_DispatchPacket(phFriNfc_NdefReg_t *NdefReg,
\r
230 uint8_t *PacketData,
\r
231 uint16_t PacketDataLength)
\r
233 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
235 if(NdefReg==NULL ||PacketData==NULL || PacketDataLength==0)
\r
237 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_PARAMETER);
\r
241 NdefReg->NdefData = PacketData;
\r
242 NdefReg->NdefDataLength = PacketDataLength;
\r
243 NdefReg->State = PH_FRINFC_NDEFREG_STATE_DIS_PKT;
\r
244 NdefReg->NumberOfNdefTypes = 0;
\r
245 NdefReg->RecordIndex = 0;
\r
246 NdefReg->RtdIndex = 0;
\r
247 status = PHNFCSTVAL(CID_NFC_NONE, NFCSTATUS_SUCCESS);
\r
252 /* Copy the relevant pointers to the context structure, change the
\r
253 FSM state, so as to trigger the process and return pending */
\r
254 NFCSTATUS phFriNfc_NdefReg_DispatchRecord(phFriNfc_NdefReg_t *NdefReg,
\r
255 phFriNfc_NdefRecord_t *RecordsExtracted)
\r
257 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
258 if(NdefReg==NULL || RecordsExtracted==NULL)
\r
260 status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_PARAMETER);
\r
264 NdefReg->RecordsExtracted = RecordsExtracted;
\r
265 NdefReg->State = PH_FRINFC_NDEFREG_STATE_DIS_RCD;
\r
267 status = PHNFCSTVAL(CID_NFC_NONE, NFCSTATUS_SUCCESS);
\r
272 uint8_t phFriNfc_NdefReg_Process(phFriNfc_NdefReg_t *NdefReg,
\r
283 if(NdefReg->NdefTypeList == NULL)
\r
285 /* No Nodes added. Return error */
\r
286 *Status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_NOT_REGISTERED);
\r
290 *Status = NFCSTATUS_SUCCESS;
\r
291 switch(NdefReg->State)
\r
293 case PH_FRINFC_NDEFREG_STATE_DIS_RCD:
\r
295 /* for START ( each node in the list NdefReg->NdefTypeList), do the following */
\r
296 for(index=0;index<NdefReg->NdefTypeList->NumberOfRTDs;index++)
\r
298 /* First, Match should be done with The TNF*/
\r
299 if( (NdefReg->NdefTypeList->Tnf[index] & PH_FRINFC_NDEFRECORD_TNF_MASK ) ==
\r
300 (NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) )
\r
302 /* Second, Match should be done with The Typelength*/
\r
303 if( NdefReg->NdefTypeList->NdeftypeLength[index] == \
\r
304 NdefReg->RecordsExtracted->TypeLength )
\r
306 /* Third, Match should be done with The Type*/
\r
308 switch(NdefReg->NdefTypeList->Tnf[index])
\r
311 /* TNF = 0X01 NFC Forum well-known type : Case sensitive */
\r
312 /* comparison is to be made. */
\r
313 if( !phFriNfc_NdefReg_Strncmp( (const int8_t *)NdefReg->NdefTypeList->NdefType[index] ,
\r
314 (const int8_t *)(NdefReg->RecordsExtracted->Type),
\r
315 NdefReg->RecordsExtracted->TypeLength))
\r
323 /* For TNF = 0X02 Media-type as defined in RFC 2046
\r
324 From iana.org, it has never been found any registered media type
\r
325 with non-ascii character ==> Comparison to be used for *types* in
\r
326 *registry*: case INSENSITIVE comparison.
\r
328 For TNF = 0X04 NFC Forum external type : ==> Comparison to be used
\r
329 for *types* in *registry* : case INSENSITIVE comparison */
\r
330 if( !phFriNfc_NdefReg_Strnicmp( (int8_t *)NdefReg->NdefTypeList->NdefType[index] ,
\r
331 (int8_t *)(NdefReg->RecordsExtracted->Type),
\r
332 NdefReg->RecordsExtracted->TypeLength))
\r
339 /* TNF = 0X03 Absolute URI as defined in RFC 3986 [RFC 3986]
\r
340 Big issue concerning the Encoding, which is actually determined
\r
341 by the application.Conclusion is that: Comparison to be used for
\r
342 *types* in *registry*: NONE. only TNF ; type should be ignored,
\r
343 and its comparison shall be done by the application. */
\r
351 /* Copy the chunked flag info to the callback parameter */
\r
352 NdefReg->CbParam->Chunked[count] = (NdefReg->RecordsExtracted->Flags & \
\r
353 PH_FRINFC_NDEFRECORD_FLAGS_CF );
\r
355 /* NOTE: Raw record and the raw record size cannot be
\r
356 copied as this itself is an extracted record ! */
\r
358 /* Copy the record in the format phFriNfc_NdefRecord_t
\r
359 to the callback parameter */
\r
360 (void) memcpy( &NdefReg->CbParam->Records[count],
\r
361 NdefReg->RecordsExtracted,
\r
362 sizeof(phFriNfc_NdefRecord_t));
\r
369 /* now, we have all the matching entries for the RTDs present
\r
370 in this particular node NdefReg->NdefTypeList.
\r
371 call the callback */
\r
374 NdefReg->CbParam->Count = count;
\r
375 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
\r
376 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
\r
380 NdefReg->CbParam->Count = 0;
\r
383 /* for END ( each node in the list NdefReg->NdefTypeList), do the following */
\r
384 if(NdefReg->NdefTypeList->Next==NULL)
\r
386 NdefReg->State = PH_FRINFC_NDEFREG_STATE_INIT;
\r
387 while(NdefReg->NdefTypeList->Previous!=NULL)
\r
389 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
\r
391 /* No further node present in the list. End of process function call */
\r
396 /* Move the linked list by one node.*/
\r
397 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Next;
\r
398 /* list is not empty so come again */
\r
403 case PH_FRINFC_NDEFREG_STATE_DIS_PKT:
\r
405 if(NdefReg->NumberOfNdefTypes == 0)
\r
407 /* First, Get all the records present in the data packet NdefReg->NdefData
\r
408 using NDEF tool library */
\r
409 /* and, get the NumberOfNdefTypes from NdefData */
\r
410 *Status = phFriNfc_NdefRecord_GetRecords( NdefReg->NdefData,
\r
411 NdefReg->NdefDataLength,
\r
413 NdefReg->IsChunked,
\r
414 &NdefReg->NumberOfNdefTypes);
\r
415 if((*Status)!= NFCSTATUS_SUCCESS)
\r
417 /* Error in the Packet. Exit from the process */
\r
419 NdefReg->NumberOfNdefTypes = 0;
\r
423 if(NdefReg->NumberOfNdefTypes > NdefReg->NumberOfRecords)
\r
425 /* There is not enough space in the arrays NdefReg->NdefTypes
\r
426 and NdefReg->IsChunked, to write NdefReg->NumberOfRecords
\r
427 number of records. Return error. */
\r
428 *Status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_BUFFER_TOO_SMALL);
\r
430 NdefReg->NumberOfNdefTypes = 0;
\r
434 /* Now, get the NdefTypes */
\r
435 *Status = phFriNfc_NdefRecord_GetRecords( NdefReg->NdefData,
\r
436 NdefReg->NdefDataLength,
\r
437 NdefReg->NdefTypes,
\r
438 NdefReg->IsChunked,
\r
439 &NdefReg->NumberOfNdefTypes);
\r
440 if((*Status)!= NFCSTATUS_SUCCESS)
\r
442 /* Error in the Packet. Exit from the process */
\r
444 NdefReg->NumberOfNdefTypes = 0;
\r
449 /* For each record, in the arry NdefReg->NdefTypes, check
\r
450 whether it matches with any of the registered RTD in the
\r
451 present node. If it matches, copy this to the Callback
\r
452 parameter array and increment count.
\r
453 If count is 8, call the callback function.
\r
454 Remember the record index that we last processed, before
\r
455 calling the callback. */
\r
457 /* for each record in the Message */
\r
458 while(NdefReg->RecordIndex < NdefReg->NumberOfNdefTypes)
\r
460 /* Extract a record from the Message */
\r
461 *Status = phFriNfc_NdefRecord_Parse(NdefReg->RecordsExtracted,
\r
462 NdefReg->NdefTypes[NdefReg->RecordIndex]);
\r
463 if((*Status)!= NFCSTATUS_SUCCESS)
\r
465 /* Error in the Record. Exit from the process */
\r
466 NdefReg->NumberOfNdefTypes = 0;
\r
470 NdefReg->newRecordextracted = 1;
\r
472 /* for each RTD in the present node */
\r
473 while(NdefReg->RtdIndex < NdefReg->NdefTypeList->NumberOfRTDs)
\r
475 /* Harsha: Fix for 0000243: [JF] phFriNfc_NdefReg_Process
\r
476 won't parse correctly chunked records */
\r
478 /* Check whether the TNF = 0x06
\r
479 PH_FRINFC_NDEFRECORD_TNF_UNCHANGED */
\r
481 if((NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) ==
\r
482 PH_FRINFC_NDEFRECORD_TNF_UNCHANGED)
\r
484 if(NdefReg->MainTnfFound == 1)
\r
486 /* Matching RTD is there */
\r
492 if(NdefReg->newRecordextracted)
\r
494 NdefReg->MainTnfFound = 0;
\r
496 /* This is a tnf other than 0x06.
\r
497 that means, this is a valid tnf */
\r
498 NdefReg->validPreviousTnf = NdefReg->RecordsExtracted->Tnf;
\r
500 /* First, Match should be done with The TNF*/
\r
501 /* Second, Match should be done with The Typelength*/
\r
502 /* Third, Match should be done with The Type*/
\r
503 if((NdefReg->NdefTypeList->Tnf[NdefReg->RtdIndex] &
\r
504 PH_FRINFC_NDEFRECORD_TNF_MASK ) ==
\r
505 (NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK ) &&
\r
506 (NdefReg->NdefTypeList->NdeftypeLength[NdefReg->RtdIndex] ==
\r
507 NdefReg->RecordsExtracted->TypeLength))
\r
510 switch(NdefReg->NdefTypeList->Tnf[NdefReg->RtdIndex])
\r
513 /* TNF = 0X01 NFC Forum well-known type : Case sensitive
\r
514 comparison is to be made. */
\r
515 if(!phFriNfc_NdefReg_Strncmp((const int8_t *)NdefReg->NdefTypeList->NdefType[NdefReg->RtdIndex],
\r
516 (const int8_t *)(NdefReg->RecordsExtracted->Type),
\r
517 NdefReg->RecordsExtracted->TypeLength))
\r
525 /* For TNF = 0X02 Media-type as defined in RFC 2046
\r
526 From iana.org, it has never been found any registered media type
\r
527 with non-ascii character ==> Comparison to be used for *types* in
\r
528 *registry*: case INSENSITIVE comparison. */
\r
530 /* For TNF = 0X04 NFC Forum external type : ==> Comparison to be used
\r
531 for *types* in *registry* : case INSENSITIVE comparison */
\r
532 if( !phFriNfc_NdefReg_Strnicmp( (int8_t *)NdefReg->NdefTypeList->NdefType[NdefReg->RtdIndex],
\r
533 (int8_t *)(NdefReg->RecordsExtracted->Type),
\r
534 NdefReg->RecordsExtracted->TypeLength))
\r
541 /* TNF = 0X03 Absolute URI as defined in RFC 3986 [RFC 3986]
\r
542 Big issue concerning the Encoding, which is actually determined
\r
543 by the application.Conclusion is that: Comparison to be used for
\r
544 *types* in *registry*: NONE. only TNF ; type should be ignored,
\r
545 and its comparison shall be done by the application. */
\r
551 if(matchFound == 1)
\r
554 NdefReg->MainTnfFound = 1;
\r
567 /* we have found a matching TNF */
\r
568 if(TnfMatchFound == 1)
\r
570 /* Copy the chunked flag info to the callback parameter */
\r
571 NdefReg->CbParam->Chunked[count] = NdefReg->IsChunked[NdefReg->RecordIndex];
\r
573 /* Copy the raw record to the callback parameter */
\r
574 NdefReg->CbParam->RawRecord[count] = NdefReg->NdefTypes[NdefReg->RecordIndex];
\r
576 /* Copy the raw record size to the callback parameter */
\r
577 NdefReg->CbParam->RawRecordSize[count] = phFriNfc_NdefRecord_GetLength(NdefReg->RecordsExtracted);
\r
579 /* Copy the record in the format phFriNfc_NdefRecord_t
\r
580 to the callback parameter */
\r
581 (void) memcpy( &NdefReg->CbParam->Records[count],
\r
582 NdefReg->RecordsExtracted,
\r
583 sizeof(phFriNfc_NdefRecord_t));
\r
586 /*if count is greater than PH_FRINFC_NDEFREG_MAX_RTD (presently 8)
\r
587 then call the callback since there can be more than
\r
588 PH_FRINFC_NDEFREG_MAX_RTD of a single type with in the packet,as a result
\r
589 call the callback and initialize count to zero.This may also happen
\r
590 when there are chunked records */
\r
593 if(count >= PH_FRINFC_NDEFREG_MAX_RTD )
\r
595 NdefReg->CbParam->Count = count;
\r
596 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
\r
597 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
\r
599 /* Only one callback per node. */
\r
600 NdefReg->RecordIndex++;
\r
605 /* If the match is already found for the UNCHANGED_TNF,
\r
606 don't comapre it again */
\r
607 if((NdefReg->RecordsExtracted->Tnf & PH_FRINFC_NDEFRECORD_TNF_MASK )
\r
608 == PH_FRINFC_NDEFRECORD_TNF_UNCHANGED &&
\r
609 TnfMatchFound == 1)
\r
615 NdefReg->RtdIndex++;
\r
617 NdefReg->newRecordextracted = 0;
\r
618 } /* for each RTD in the present node
\r
619 while(NdefReg->RtdIndex < NdefReg->NdefTypeList->NumberOfRTDs) */
\r
621 /* One Record processing done for this node */
\r
623 NdefReg->RtdIndex = 0;
\r
624 NdefReg->RecordIndex++;
\r
625 } /* while(NdefReg->RecordIndex<NdefReg->NumberOfNdefTypes) */
\r
627 /* One node has been checked. Move to the next node */
\r
631 NdefReg->CbParam->Count = count;
\r
632 NdefReg->CbParam->CbContext = NdefReg->NdefTypeList->CbContext;
\r
633 NdefReg->NdefTypeList->NdefCallback (NdefReg->CbParam);
\r
637 NdefReg->CbParam->Count = 0;
\r
640 if(NdefReg->NdefTypeList->Next==NULL)
\r
642 /* All the nodes have been checked. Return */
\r
643 NdefReg->State = PH_FRINFC_NDEFREG_STATE_INIT;
\r
644 while(NdefReg->NdefTypeList->Previous!=NULL)
\r
646 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Previous;
\r
648 /* No further node present in the list.
\r
649 End of Dispatch packet function. Return TRUE*/
\r
654 /* Move the linked list by one node.*/
\r
655 NdefReg->NdefTypeList = NdefReg->NdefTypeList->Next;
\r
656 /* list is not empty so come again */
\r
660 /* Start from the first record again. */
\r
661 NdefReg->RecordIndex = 0;
\r
662 NdefReg->RtdIndex = 0;
\r
668 *Status = PHNFCSTVAL(CID_FRI_NFC_NDEF_REGISTRY, NFCSTATUS_INVALID_DEVICE_REQUEST);
\r
669 /* Unknown state Error exit from the process function */
\r