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

Beep/flash the ACR122 when a tag is detected #57

Merged
merged 2 commits into from Nov 10, 2016

Conversation

svvitale
Copy link
Contributor

@svvitale svvitale commented Nov 8, 2016

I've added a couple methods to the abstract Device class that are intended to turn on/off an LED and buzzer if available. The default implementation does nothing. These methods are called by the _rdwr_connect method of the ContactlessFrontend, and can be disabled by setting the rdwr option 'beep-on-connect' to False.

The only device I have available is the ACR122, so I've implemented the on/off functionality in that particular device class. If other devices support similar notifications, it can easily be implemented in the device's class with no further changes to ContactlessFrontend.

This is my first contribution to nfcpy, so please let me know if there are any stylistic or documentation changes that I need to make. Thank you.

…uzzer when a tag is detected. Implement this method for the ACR122 device, and enable the behavior by default in the ContactlessFrontend.connect call.
Copy link
Member

@nehpetsde nehpetsde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, this looks mostly acceptable. Just please reformat the two lines in acr122.py (188 and 192) to fit within 80 characters.

@svvitale
Copy link
Contributor Author

svvitale commented Nov 9, 2016

Done. Let me know if I can help with the Python 3 changes at all.

@svvitale
Copy link
Contributor Author

svvitale commented Nov 9, 2016

It's also worth mentioning that the ContactlessFrontend instance does not close gracefully for these ACR122 devices on the master branch. stable/0.11 works fine.

@nehpetsde nehpetsde merged commit 3c03cc5 into nfcpy:master Nov 10, 2016
@nehpetsde
Copy link
Member

Thanks, I could reproduce the closing issue and found the cause. Yet to think up the best solution but it'll come.

@nehpetsde
Copy link
Member

The closing issue is now solved.

@svvitale svvitale deleted the beep-on-connect branch November 10, 2016 16:35
@svvitale
Copy link
Contributor Author

Verified that my ACR122 closes successfully with the latest version of master. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants