I'm trying to integrate Twisted with libusb-1 The libusb-1 Python wrapper offers a USBPoller class to "allow integration of USB event polling in a file-descriptor monitoring event loop." The class expects to receive a 'poller' object, again quoting from the documentation:
poller is a polling instance implementing the following methods: - register(fd, event_flags) event_flags have the same meaning as in poll API (POLLIN & POLLOUT) - unregister(fd) - poll(timeout) timeout being a float in seconds, or None if there is no timeout. It must return a list of (descriptor, event) pairs. Note: USBPoller is itself a valid poller. I feel like it should be obvious, but I can't see what would be the correct way to integrate this with Twisted. My particular application is to enable networking over the ANT+ protocol via a small USB key. My approach is that I'm trying to write a transport. When that's working I can start to build a Protocol. Is that sound? Any pointers would be welcome. The USBPoller class can be viewed here: https://github.com/vpelletier/python-libusb1/blob/master/usb1.py Thanks Dónal _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python