Do you have questions about writing plugins or scripts in Python? Meet the coders here.
- Plugin Developer
- Posts: 881
- Joined: Sun Feb 12, 2006 9:03 am
I want to improve the reading of HID data.
Currently I have this code
Code: Select all
rc, buf = win32file.ReadFile(handle, n, self._overlappedRead)
if rc == 997: #error_io_pending
#waiting for an event
self.abort = True
The control always flows in the rc == 997 condition. When data arrives, the events gets set and i can process the data in buf. When the device gets disconnected the event also gets set and my data processing algorithms runs on invalid data. I only get the error in the next loop, when I call ReadFile again.