Skip to content

Instantly share code, notes, and snippets.

@syaro
Created May 24, 2016 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syaro/1896d9ca3c9d8b95e0e63739718631cd to your computer and use it in GitHub Desktop.
Save syaro/1896d9ca3c9d8b95e0e63739718631cd to your computer and use it in GitHub Desktop.
import nfc
import time
servcode = 0x110B
def connected(tag):
service_code = [nfc.tag.tt3.ServiceCode(servcode >> 6, servcode & 0x3f)]
students_id = [nfc.tag.tt3.BlockCode(i) for i in range(1, 2)]
print tag.read_without_encryption(service_code, students_id)
time.sleep(3)
clf.connect(rdwr={'on-connect': connected})
clf = nfc.ContactlessFrontend('usb')
clf.connect(rdwr={'on-connect': connected})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment