0

I am using HID to write data to a microcontroller and it works perfectly upon start-up allowing me to send the data. However, sometimes I receive the error message "hid_write/GetOverlappedResult: (0x000003E3) the I/O operation has been aborted because of either a thread exit or an application request." and the program exits. I understand this is due to using unwrap(), but I want to handle this error and I am not sure how to interpret the presented error.

When I restart the program, it is able to connect and transmit successfully. However, the error will eventually show up again, causing the program to exit. It is unclear when the error will occur, but it happens consistently.

  • this sounds like you are writing to usb port which is serial port, meaning only one process can read/write to it, probably the OS or some daemon are doing some read write on that port while your code doing same making the error. I would suggest you to check "dmesg" in linux or "Event Viewer" in windows can tell you more. Or you have 2 threads doing readwrite on the port without waiting the other one :) then you should better organize your threads. Question is little bit too broad, it would be better if you shared some code and longer stacktrace, cargo toml to see what version. – ozkanpakdil Jun 25 '23 at 13:35

0 Answers0