for o, a in opts: if o == '-d': debug= True if o == '-f': nfcreader= int(a) readertype= RFIDIOt.rfidiot.READER_LIBNFC if o == '-g': nogui= True if o == '-h': help= True printoptions() if o == '-n': noinit= True if o == '-N': readertype= RFIDIOt.rfidiot.READER_LIBNFC card= RFIDIOt.rfidiot(readernum,readertype,line,speed,timeout,debug,noinit,nfcreader) card.libnfc_listreaders() os._exit(True) if o == '-r': readernum= a readertype= RFIDIOt.rfidiot.READER_PCSC if o == '-R': readertype= eval(a) if o == '-l': line= a if o == '-L': readertype= RFIDIOt.rfidiot.READER_PCSC readernum= 0 card= RFIDIOt.rfidiot(readernum,readertype,line,speed,timeout,debug,noinit,nfcreader) card.pcsc_listreaders() os._exit(True)
for o, a in opts: if o == '-d': rfidiotglobals.Debug = True if o == '-f': nfcreader = int(a) readertype = RFIDIOt.rfidiot.READER_LIBNFC if o == '-g': nogui = True if o == '-h': help = True printoptions() if o == '-n': noinit = True if o == '-N': readertype = RFIDIOt.rfidiot.READER_LIBNFC card = RFIDIOt.rfidiot(readernum, readertype, line, speed, timeout, rfidiotglobals.Debug, noinit, nfcreader) card.libnfc_listreaders() os._exit(True) if o == '-r': readernum = a readertype = RFIDIOt.rfidiot.READER_PCSC if o == '-R': try: readertype = eval(a) except: readertype = eval('RFIDIOt.rfidiot.' + a) if o == '-l': line = a if o == '-L': readertype = RFIDIOt.rfidiot.READER_PCSC readernum = 0
nogui = True if o == '-h': help = True printoptions() if o == '-n': noinit = True if o == '-r': readernum = a readertype = RFIDIOt.rfidiot.READER_PCSC if o == '-R': readertype = eval(a) if o == '-l': line = a if o == '-L': readertype = RFIDIOt.rfidiot.READER_PCSC readernum = 0 card = RFIDIOt.rfidiot(readernum, readertype, line, speed, timeout, debug, noinit) card.pcsc_listreaders() os._exit(True) if o == '-s': speed = int(a) if o == '-t': timeout = int(a) card = RFIDIOt.rfidiot(readernum, readertype, line, speed, timeout, debug, noinit) except getopt.GetoptError, e: print "RFIDIOtconfig module ERROR: %s" % e printoptions() args = []
remote= args[0][7:] rd_remote= True remote_type= 'READER' emulator= card else: rd_remote= False if remote: host= remote[:string.find(remote,':')] port= int(remote[string.find(remote,':') + 1:]) connection= connect_to(host, port, remote_type) else: try: readernum= int(args[0]) emulator= RFIDIOt.rfidiot(readernum,card.readertype,'','','','','') print ' Emulator:', emulator.info('') if not emulator.readersubtype == card.READER_ACS: print "EMULATOR is not an ACS" os._exit(True) except: print "Couldn't initialise EMULATOR on reader", args[0] os._exit(True) # always check at least one device locally if not card.readersubtype == card.READER_ACS: print "READER is not an ACS" os._exit(True) if card.acs_send_apdu(PN532_APDU['GET_PN532_FIRMWARE']):