def stop(self): """Allows stopping the device, restart using start()""" if self._running: ret = hid.hid_close(self._hid) if ret != hid.HID_RET_SUCCESS: sys.stderr.write("hid_close failed with return code %d.\n" % ret) self._running = False hid.hid_cleanup()
def cleanup(): _hid_raise("cleanup", hid.hid_cleanup()) IS_INITIALIZED[0] = False