From: Cmaster C. <cma...@ho...> - 2009-05-21 07:34:30
|
Ah thanks, I see the problem now :D I just changed it as you suggested and it now works perfectly!!! Thanks so much for your help :D > Date: Wed, 20 May 2009 10:19:31 -0700 > From: ti...@pr... > To: lib...@li... > Subject: Re: [Libusb-devel] FW: (no subject) > > Cmaster Clapson wrote: > > > > I'm afraid I don't understand. > > According to the documentation at > > http://libusb.sourceforge.net/api-1.0/group__syncio.html#gc412bda21b7ecf57e4c76877d78e6486 > > The function follows: > > int libusb_interrupt_transfer ( struct libusb_device_handle * > > dev_handle, unsigned char endpoint, unsigned char * data, int lenth, > > int * transferred, unsigned int timout) > > > > In my program zboard is the libusb_device_handle, ENDPOINT which is > > defined as 0x82 is the endpoint, buf is the place I expect data to end > > up declared as unsigned char buf[8], 8 is the length, length is the > > transferred which is declared as int *length = NULL, timeout is 0. > > It seems to me I have all arguments? > > Or is the problem that transferred = NULL? > > You have a basic misunderstanding of C here. The parameter is defined > as an int *, but that doesn't mean it wants an "int *" as an input. It > means that it wants a pointer to an int as an output. YOU have to > supply the storage. Specifically, you have: > int * transferred = NULL; > libusb_interrupt_transfer( ... , transferred, ... ); > > But you should have: > int transferred = 0; > libusb_interrupt_transfer( ... , &transferred, ... ); > > -- > Tim Roberts, ti...@pr... > Providenza & Boekelheide, Inc. > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables > unlimited royalty-free distribution of the report engine > for externally facing server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Libusb-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel _________________________________________________________________ Brrr... its getting cold out there… Find someone to light your fire this winter at Match.co.nz http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Enz%2Emsn%2Ecom%2Fchannel%2Findex%2Easpx%3Ftrackingid%3D1048628&_t=773568480&_r=nzWINDOWSliveMAILemailTAGLINES&_m=EXT |