|
From: Paul U. <pau...@gm...> - 2011-04-15 07:47:13
|
Hi Tim,
First, I thank you for your answer.
I use a header file in which one I define the usb_handle and the VID/PID.
Then, concerning the double usb_write_bulk, I just did it to try... When
this function is done only once, I get the same problem.
Then I have tried to change the data as: char data[8] = {0x.. , 0x.. , 0x..
, 0x.. , 0x.. , 0x.. , 0x.. , 0x..};
I get the same error again...
Concerning the endpoint number, I got it using USBTrace (on windows). Is
there any differencies about endpoint numbers with Linux and Windows.
Anyway, I tried to change this value with different endpoint numbers, that
changed anything.
If you have any idea else to fix my problem, please help ?
Regards,
Paul
2011/4/14 Tim Roberts <ti...@pr...>
> pauldamool wrote:
> > I am trying to communicate with an usb device (NI GPIB-USB-B) to get some
> > physical measurements...
> > I find the device, but the function usb_bulk_write returns the following
> > error :
> >
> > error submitting URB: No such file or directory
> >
> > I am probably doing something wrong, and I spent lots of time to find my
> > mistake... Any help pointing out my error would be appreciated.
>
> Have you double-checked the endpoint numbers and endpoint types?
>
>
> > //struct usb_dev_handle *usb_handle = NULL;
> > int verbose_mode = 0;
>
> If that's commented out, where are you storing the usb_handle?
>
>
> > /***********************************************/
> > // MAIN
> > /***********************************************/
> >
> > int main(void){
> >
> > int i;
> >
> > int returnValue = connectGPIB();
> >
> > if(returnValue < 0){
> > fprintf(stderr, "Connexion : failed\n");
> > return -1;
> > }
> > else{printf("Connexion : succeeded\n");}
> >
> > char dataInit[72] = "/0x09/0x1A/0x00/0x03/0x10/0x00/0x01/0x33";
>
> The first major problem you have is that you need backslashes instead of
> forward slashes. You are expecting that to be an 8-byte string, but it
> is actually a 40-byte string. In fact, I'm not sure why you would use a
> string at all for this:
>
> unsigned char dataInit[8] = { 0x09, 0x1A, 0x00, 0x03, 0x10, 0x00,
> 0x01, 0x33 };
>
> > for(i=0;i<2;i++){
> > returnValue = usb_bulk_write(usb_handle, EP_OUT , dataInit, 8,
> > BULK_TIMEOUT);
> > }
>
> Why do you do this twice? You don't check the return value in between,
> so you're going to lose whatever error was returned from the first call.
>
> --
> Tim Roberts, ti...@pr...
> Providenza & Boekelheide, Inc.
>
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> Libusb-devel mailing list
> Lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libusb-devel
>
|