コード例 #1
0
def antenna_configuration_2():
    ep.write(bytearray(commands.set_antenna_port_state_2))
    response.print_dictionary(response.read_antenna(dev))

    ep.write(bytearray(commands.set_sense_threshold_2))
    response.print_dictionary(response.read_antenna(dev))

    ep.write(bytearray(commands.set_antena_config_2))
    response.print_dictionary(response.read_antenna(dev))
コード例 #2
0
def run_inventory():
    print 'intentory'
    ep.write(bytearray(commands.set_mode))
    print bytearray(commands.set_mode)
    response.print_dictionary(response.read_antenna(dev))

    # start inventory 0x40
    ep.write(bytearray(commands.tag_inventory))
    response.print_dictionary(response.read_antenna(dev))
    response.print_dictionary(response.read_antenna(dev))
コード例 #3
0
def initialization():
    # cancel 0x50
    ep.write(bytearray(commands.cancel_operation))
    # get mac 0x67(x5)
    for item in commands.read_mac:
        ep.write(bytearray(item))
        response.print_dictionary(response.read_antenna(dev))
    # get firmware 0x60
    ep.write(bytearray(commands.get_firmware))
    response.print_dictionary(response.read_antenna(dev))
    # get version 0x6c
    ep.write(bytearray(commands.get_version))
    response.print_dictionary(response.read_antenna(dev))
    # get update_number 0x6d
    ep.write(bytearray(commands.get_upd_num))
    response.print_dictionary(response.read_antenna(dev))
    # get bootloader 0x64
    ep.write(bytearray(commands.get_bootloader))
    response.print_dictionary(response.read_antenna(dev))
    # get update_number 0x07
    ep.write(bytearray(commands.mac_registers))
    response.print_dictionary(response.read_antenna(dev))
コード例 #4
0
def receive_data():
    response.read_antenna(dev)
    response.read_antenna(dev)
    print '-----------------------------------'
コード例 #5
0
    receive_data()
    receive_data()
    printToFile('Run Inventory success')


def starting_process():
    discover_reader()
    initialization()
    print 'antenna1'
    antenna_configuration()
    print 'antenna2'
    antenna_configuration_2()
    print 'session'
    config_session()
    print 'intentory'
    run_inventory()
    print 'done'

starting_process()

while 1:
    if response.read_antenna(dev) != None:
        pass
    else:
        if usb.core.find(idVendor=idVendor, idProduct=idProduct):
            print 'ok'
        else:
            printToFile('Error Lost Reader')
            time.sleep(5)
            starting_process()
コード例 #6
0
    response.print_dictionary(response.read_antenna(dev))

    # start inventory 0x40
    ep.write(bytearray(commands.tag_inventory))
    response.print_dictionary(response.read_antenna(dev))
    response.print_dictionary(response.read_antenna(dev))

discover_reader()
initialization()
antenna_configuration()
antenna_configuration_2()
run_inventory()


while 1:
    if response.read_antenna(dev) != None:
        pass
    else:
        if usb.core.find(idVendor=0x24e9, idProduct=0x0861):
            print 'ok'
        else:
            time.sleep(5)
            print "LED OFF"
            discover_reader()
            initialization()
            antenna_configuration()
            antenna_configuration_2()
            run_inventory()


# # release the device