Changeset 11534 for main/pyfprint/trunk


Ignore:
Timestamp:
24 Mar 2014, 15:33:03 (11 years ago)
Author:
uli
Message:

Add wrapper for detection function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/pyfprint/trunk/src/fprint.py

    r11530 r11534  
    159159
    160160discover_devs = lib.fp_discover_devs
     161discover_devs.restype = ctypes.POINTER(
     162    ctypes.POINTER(fp_dscv_dev))
     163
     164# Library
     165fp_init = lib.fp_init
     166fp_exit = lib.fp_exit
     167
     168lib.fp_set_debug.argtypes = [ctypes.c_int,]
     169fp_set_debug = lib.fp_set_debug
    161170
    162171
    163172if __name__ == '__main__':
    164     print discover_devs()
     173    fp_init()
     174    devs = discover_devs()
     175
     176    if isinstance(devs, ctypes.POINTER(ctypes.c_void_p)):
     177        print "No device detected!"
     178    else:
     179        print "Something found: "
     180        print devs
    165181    import pdb; pdb.set_trace()
     182    fp_exit()
Note: See TracChangeset for help on using the changeset viewer.