예제 #1
0
def write():

    
    #first finger scan
    setBaud()    
    data = genImg.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(ord(c)) for c in s])
    genImg.parse(s)
    # generate character file of the finger image.
    setBaud()
    data = Img2Tz.getHeader(0x01)
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(ord(c)) for c in s])
    Img2Tz.parse(s)

    setBaud()
    data = Search.getHeader(0x01, 0x0000, 0x0064)
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(ord(c)) for c in s])
    print Search.parse(s)
예제 #2
0
def write():

    
    #first finger scan
    setBaud()    
    data = genImg.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    genImg.parse(s)
    # generate character file of the finger image.
    setBaud()
    data = Img2Tz.getHeader(0x01)
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    Img2Tz.parse(s)


    #second finger scan.
    setBaud()    
    data = genImg.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    genImg.parse(s)
    #generate character file of the finger image.
    setBaud()
    data = Img2Tz.getHeader(0x02)
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    Img2Tz.parse(s)


    #create RegModel
    setBaud()    
    data = RegModel.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    RegModel.parse(s)
    #getTemplateNumber
    setBaud()    
    data = TemplateNum.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    num = TemplateNum.parse(s)
    print ("recived template Number is "+ str(num))

    """
    setBaud()    
    data = DeleteAll.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(ord(c)) for c in s])
    print(DeleteAll.parse(s))"""

    
    setBaud()    
    data = Store.getHeader(0x01,int(num)+1 )
    print([hex(int(c)) for c in data])
    ser.write(bytearray(int(x) for x in data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    print ( len(s))
    Store.parse(s)

     #getTemplateNumber
    setBaud()    
    data = TemplateNum.getHeader()
    ser.write(bytearray(data));
    time.sleep(1)
    s = ser.read(ser.inWaiting())
    print([hex(c) for c in s])
    num = TemplateNum.parse(s)
    print( "recived template Number is "+ str(num))