Skip to content

Add option to prevent halt when NFC tag not found on begin()#80

Open
smartin015 wants to merge 1 commit intodon:masterfrom
smartin015:master
Open

Add option to prevent halt when NFC tag not found on begin()#80
smartin015 wants to merge 1 commit intodon:masterfrom
smartin015:master

Conversation

@smartin015
Copy link

I'm working on a project where an NFC reader may not always be attached. The current implementation of begin() halts if the device isn't found on init - this is kind of a dealbreaker for my use case.

So, my change adds an optional flag to NfcAdapter::begin() that allows the user to bypass the halt behavior. The behavior without specifying this flag is unchanged, so there should be no worry about backwards compatibility.

I've also made begin() return true if the NFC board was initialized, and false otherwise to aid in potential sensing / retry logic on the user side.

Thanks for maintaining this great repo :)

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.

1 participant