Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster way to detect when a card disconnects #50

Closed
dimpolo opened this issue Oct 25, 2021 · 1 comment
Closed

Faster way to detect when a card disconnects #50

dimpolo opened this issue Oct 25, 2021 · 1 comment

Comments

@dimpolo
Copy link

dimpolo commented Oct 25, 2021

Is ther a faster way to detect when a card disconnects other than continuously calling pn532.read_passive_target() until it times out?
_COMMAND_INLISTPASSIVETARGET can be rather slow to respond (sometimes >100ms).

I tried this:
pn532.call_function(_COMMAND_GETGENERALSTATUS, 8)

It reports the number of targets connected, but it doesn't update until I run some other target command.
Does someone know if there's a different command for this?

@dimpolo
Copy link
Author

dimpolo commented Oct 27, 2021

I found a way:

pn532.call_function(_COMMAND_INDESELECT, 1, [1])
pn532.call_function(_COMMAND_INSELECT, 1, [1])

Feel free to close this.
Feel free to add a check_if_target_still_there method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants