Overlapped I/O operation is in progress. #433
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#433
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm trying to write to a HID device, but I keep getting the same error. The error in question being
hid_write/WaitForSingleObject: (0x000003E5) Overlappende I/O-bewerking wordt uitgevoerd.. Note that this is Dutch. The translation would behid_write/WaitForSingleObject: (0x000003E5) Overlapping I/O-changes are being made.I'm not exactly sure if "changes" is the correct translation.The device in question is a Skylanders portal. Other applications seem to work fine, but when I try to write to it doesn't work.
My code to write to the portal is:
I copied this from another project, but it seems to find the portal just fine and I am able to read incoming data using hid_read.
Okay. So the correct error translation is:
Overlapped I/O operation is in progress.Can you confirm you're opening the device with correct usage_page/usage?
hid_open does not have a usage page variable
Use what you call
attributesto filter for the correct usage_page/usage, and thenhid_open_path(attributes->path).Can you confirm that your device doesn't use numbered reports, and the only report you have is 20 bytes long?
I'm pretty sure it does not use numbered reports, from what I can gather from https://github.com/tresni/PoweredPortals/wiki/USB-Protocols and https://pastebin.com/EqtTRzeF
usage page gives 65280, usage is 1 and weirdly, interface is -1
also, I updated my portal finder to just
My point is that your device may have several usage_page/usages, and each unique pair is reported as a separate device.
And the report you're interesting is tight to a specific usage_page/usages.
It may happen, that you're using a "wrong" device to
hid_write.But what is the size of the report?
I can't predictably tell what happens if you pass more data to the
hid_writethan the report size.Enumerate only results in a single device. And similar programs also use a 32 byte buffer
With the same device?
Yes. With the same device.
So you have access to the working source code for this example?
“Working”. There are several projects, but they’re all years old. And either: 1. Don’t compile 2. Don’t support visual studio. For the ones I could get binaries off, they work just fine. I don’t know why my code doesn’t.
One thing I did notice is that when using a usb monitor my code’s data uses bulk and interrupt where at least one other reports using interface. Weirdly enough, this code also uses hidapi and hid_write
I’ll try and get some screenshots of this tomorrow to show what I mean.
Oh. Something I forgot to note: the device constantly sends status packets. This might be the origin of the original error. Should have told that earlier.
That shouldn't matter.
Logically I don't see why this code shouldn't work (from HIDAPI perspective).
Do you happened to know what version of HIDAPI uses that "working" binary that you mentioned?
Is there a chance it does more than that
hid_write(e.g. set some feature report first).No. A version from at the latest 2017. https://github.com/capull0/SkyDumper This is the project some of my code is based off of. The hidapi files don’t seem to contain a version definition
Okay. Looking at the source of the reference program I used, the hid files are either really old, or manually modified.
Yes. I think they modified the hid write function.
Okay. The other programs indeed use a modified version of hidapi. Thank you for attempting to help me. It's all resolved now.