Re: usb_bulk_read return -22

Xiaofan Chen <[email protected]> Fri, 3 Apr 2020 10:27:31 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUA5Lw=WnGfPn+GS+m9_pXVALm+H-nZGYsRSoJOBJOP3xg@mail.gmail.com>
On Thu, Apr 2, 2020 at 1:00 AM Ze Hou Zhang <[email protected]> wrote:
>
> Hi All
> I dont have a lot experience for developping embedded system.
> I encounter this problem
> My hardware is :
>         int vid = 0x24aa;
>         int pid = 0x1000;
>         std::string firmwarePartNum = "170003";
>         std::string firmwareDesc = "FX2 USB Board";
>         bool isSupported;
>         unsigned int defaultPixels = 1024;
>         unsigned int spectraBlockSize = 1024 * 2;
>         unsigned int usbDelayMS = 0;
>         bool hasDefaultTECSetpointDegC = false;
>         int defaultTECSetpointDegC = 0;
> =============================================================
>            int size = 512;
>             char* buf = new char[size];
>             int endpoint = 130;
>             int timeout = 150;
>
>             int isok = usb_bulk_read(*deviceHandle, endpoint, bytes, size, timeout);
>
>            Output:  ok = -22
> Thanks
>

You have to know the communication protocol of the device in order
to use libusb-win32. In your case, you need to make sure your device
is sending data.


-- 
Xiaofan