NFC Tag Data Reader Function

  • Share this:

Code introduction


This function reads data from an NFC tag using the PyNFC library and returns the data as a list.


Technology Stack : PyNFC

Code Type : Function

Code Difficulty : Intermediate


                
                    
def read_tag_data(tag):
    # This function reads data from a NFC tag and returns the data in a list
    from nfc import NfcReader
    reader = NfcReader()
    reader.connect()
    tag_data = reader.read_tag(tag)
    reader.close()
    return tag_data                
              
Tags: