Shop OBEX P1 Docs P2 Docs Learn Events
Need clarification for Queue array — Parallax Forums

Need clarification for Queue array

chioskichioski Posts: 17
edited 2013-07-16 05:50 in General Discussion
Hi.,


I am doing RFID project using nRF24L01 IC.I developed this project firmware in c language.
My question is

1)If the 1000 RFID tag transmits data in single reader,we already stored all tag ID into the Reader.

2)Now i wrote the C code for the,stored single tag ID into the reader,but i am going to store 1000 tag ID into the RFID Reader.

3)So i planned to use queue array concept,Please suggest me how can i store more tag ID using queue array concept using C language?

Best Regards.,
Chioski

Comments

  • SRLMSRLM Posts: 5,045
    edited 2013-06-21 00:38
    What are you asking? Are you asking how to implement a queue for the tags? I'd implement it as an array of arrays, eg.
    char queue[QUEUE_LENGTH][TAG_LENGTH]
    

    Then, you can use a standard queue algorithm to add and delete from the queue.
  • chioskichioski Posts: 17
    edited 2013-06-21 00:42
    Thanks for the prompt reply.

    What you meant by Queue_length?Its Tag ID or other?
    Please explain the Tag_length?
  • SRLMSRLM Posts: 5,045
    edited 2013-06-21 02:22
    The code that I posted declares a two dimensional array. It sets the "unit" of the array to be TAG_LENGTH bytes big, and sets QUEUE_LENGTH spots in the queue.

    Constants are typically capitalized in C, and I've followed that notation here.
  • chioskichioski Posts: 17
    edited 2013-06-21 02:40
    Thanks for your explanation.,

    1)I am clear the TAG_LENGTH means bytes big,for eg (0x32,0x56,0x11,0x98,0x72) this tag length is 5.
    2)I had a little bit doubt in queue_length,did you mean Queue length = No.of Tags.
    (if we use 10 tags,the queue length is 10)Am ryte.
    Kindly clarify this..

    Best Regards.,
    Chioski
  • chioskichioski Posts: 17
    edited 2013-07-16 05:44
    Please clarify the above query....
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-16 05:50
    Do you understand what a queue is? Do you understand how they are implemented? TAG_LENGTH is the number of bytes used to store a tag. QUEUE_LENGTH is the size of the queue. In your case, it's the number of tags that can be stored in the queue.
Sign In or Register to comment.