Is there a way that I can get this procedure to time-out after some user specified number of seconds -
readPassiveTargetID(uint8_t cardbaudrate, uint8_t * uid, uint8_t * uidLength)
I want to be able to do other stuff should there be no card to read.
NFC Card Timeout?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: NFC Card Timeout?
using which product?
- ktownsend
- Posts: 1447
- Joined: Thu Nov 05, 2009 2:18 am
Re: NFC Card Timeout?
You'll need to provide more information to offer any helpful response (what are you using and what do you want to do and on what HW), but if you mean provide a timeout on the HW side, no I don't believe you can setup a timeout for the PN532. What you send the command in this function, the PN532 will wait forever until a tag enters the field and then will spit out a response, even if you were in the middle of something else.
- scott_42
- Posts: 130
- Joined: Mon May 30, 2011 10:46 am
Re: NFC Card Timeout?
Yes you could modify the library code to do this. You will want to configure the MxRtyPassiveActivation field in the RFConfiguration MaxRetries before you call InListPassiveTarget. The default value (0xFF) is try forever. Then you can add in any logic you want to figure out the wait time and how many times to call InListPassiveTarget.RUInsane wrote:Is there a way that I can get this procedure to time-out after some user specified number of seconds -
readPassiveTargetID(uint8_t cardbaudrate, uint8_t * uid, uint8_t * uidLength)
I want to be able to do other stuff should there be no card to read.
If you are interested in this, I would suggest you read the PN532 User Manual which has all of this information and more.
- ruinsane
- Posts: 8
- Joined: Thu Apr 26, 2012 2:09 pm
Re: NFC Card Timeout?
Thanks... that did it. I modified the library code in the way you described and everything is happy and pink now.
- ktownsend
- Posts: 1447
- Joined: Thu Nov 05, 2009 2:18 am
Re: NFC Card Timeout?
Scott:scott-42 wrote:Yes you could modify the library code to do this. You will want to configure the MxRtyPassiveActivation field in the RFConfiguration MaxRetries before you call InListPassiveTarget. The default value (0xFF) is try forever. Then you can add in any logic you want to figure out the wait time and how many times to call InListPassiveTarget.RUInsane wrote:Is there a way that I can get this procedure to time-out after some user specified number of seconds -
readPassiveTargetID(uint8_t cardbaudrate, uint8_t * uid, uint8_t * uidLength)
I want to be able to do other stuff should there be no card to read.
If you are interested in this, I would suggest you read the PN532 User Manual which has all of this information and more.
Looks like I need to dig back into the manual myself. Thanks for the heads up.
-
- Posts: 1
- Joined: Tue Mar 18, 2014 6:20 am
Re: NFC Card Timeout?
Hey,
I need the same - can you describe how do you modified the library? Can you post the lib?
Thanks!
I need the same - can you describe how do you modified the library? Can you post the lib?
Thanks!
Please be positive and constructive with your questions and comments.