def taskBadgeScan():

    retcode = SCAN.scanInit()
    while 1:
        badgeId = SCAN.watchPort()  # wait here until a badge is scanned
        eventQ.put( (EVENT_MSG_BADGE_SCAN,badgeId, 0 ) )
        print "\nIn taskBadgeScan - badge scanned event", badgeId
Beispiel #2
0
def badgeScanThread(threadName, delay):
    retcode = SCAN.scanInit()
    if retcode == "SUCCESS":
        print "%s: %s" % (threadName, time.ctime(time.time()) )
    else:
        print "FAILED ScanInit %s/n%s" % (retcode, time.ctime(time.time()) )
        #LCD.lcd_string(retcode,LCD.LCD_LINE_1)
        #LCD.lcd_string(time.ctime(time.time()),LCD.LCD_LINE_2)
        
    while 1:
        time.sleep(delay)
        userId = SCAN.watchPort()  # wait here until a badge is scanned
        userName = DB.queryBadgeId(userId)
        print "badgeScanThread %s: %s" % (userName.text, userId )