Ejemplo n.º 1
0
 def __init__(self, id=None, errstream=sys.stderr):
     self._id = None
     self._error = errstream
     # Debugging
     if DEBUG:
         hid.hid_set_debug(hid.HID_DEBUG_ALL)
         hid.hid_set_debug_stream(self._error)
         hid.hid_set_usb_debug(0)
     # Initialisation
     if not hid.hid_is_initialised(): # Doesn't seem to work
         try: # Belt AND braces, Sir?
             hid.hid_init()
         except HIDError:
             pass
     self._interface = hid.hid_new_HIDInterface()
     # Ensure we only use one HIDMatcher class per
     # type of sensor, with some reflection-fu.
     #if not 'MATCHER' in self.__class__.__dict__:
     if not hasattr(self.__class__, 'MATCHER'):
         self.__class__.MATCHER = HIDMatcher(self.__class__.VID,
                                             self.__class__.PID)
     return
Ejemplo n.º 2
0
def set_debug_stream(stream):
    '''Send debug messages to a specific Python output stream (such as
    sys.stdout or sys.stderr.'''
    hid.hid_set_debug_stream(stream)
Ejemplo n.º 3
0
def set_debug_stream(stream):
    hid.hid_set_debug_stream(stream)
Ejemplo n.º 4
0
def set_debug_stream(stream):
    '''Send debug messages to a specific Python output stream (such as
    sys.stdout or sys.stderr.'''
    hid.hid_set_debug_stream(stream)
Ejemplo n.º 5
0
def set_debug_stream(stream):
    hid.hid_set_debug_stream(stream)