bloguetronica / cp2130-qt

A C++ class that uses libusb to interface with CP2130 devices. It can be used to configure the OTP ROM of such devices, as well as to control them. The class was made for Qt. If you wish to use a derived non-Qt version, please refer to https://github.com/bloguetronica/cp2130.
0 stars 0 forks source link

Device disconnect is not always reported #7

Closed samuelfmlourenco closed 3 years ago

samuelfmlourenco commented 3 years ago

When disconnecting a CP2130 device, the action is not always reported as a disconnection. This was tested on several OSes, including Devuan (in order to exclude any systemd stupidity). Bulk transfers and control transfers may return -1 (LIBUSB_ERROR_IO) as well as the expected -4 (LIBUSB_ERROR_NO_DEVICE) when the device is disconnected. On Devuan, control transfers may also return -9 (LIBUSB_ERROR_PIPE) upon the same event.

samuelfmlourenco commented 3 years ago

Tested successfully. Detected disconnection consistently, regardless of the OS or environment.