0

Can I somehow restart usb stall error without using winusb, libusb libraries on windows? Can I do this using only functions from windows.h/winbase.h?

The program is a library, written in C using BCB5.

Now I communicating with device using function CreateFile for conneting and WriteFile/ReadFile to read, write data from windows.h. This libary is used by external applications which work on windows and linux.

The device is a COM device, connected by USB.

InKronos
  • 1
  • 1
  • 3
  • 1
    What kind of USB device are you working with? A standardized USB class or a vendor specific one? What driver do you use for the device? Is this question for Windows only? How does the C program communicate with the USB device if not by WinUSB/libUSB? Why do you want to avoid WinUSB calls? – Codo Mar 26 '21 at 14:24
  • WinUSB and libusb most likely won't help anyway as the device doesn't use the WinUSB or libusb drivers. I would add different tags to the question and target it more at Windows and device management. Changes are it can be done with [DeviceIoControl[(https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol) and one of the [usbioctl](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/usbioctl/) commands. – Codo Mar 26 '21 at 15:13
  • But I must install windows SDK to use usbioctl command? – InKronos Mar 31 '21 at 12:24
  • That's to be expected as you want low-level access to devices. – Codo Mar 31 '21 at 12:33
  • I've used IOCTL_INTERNAL_USB_CYCLE_PORT and IOCTL_INTERNAL_USB_RESET_PORT and neither of this commands work – InKronos May 06 '21 at 10:54

0 Answers0