From: seeism <she...@gm...> - 2008-07-15 08:57:11
|
I tried creating buffer size of read and write transfers to the max packet size(512 bytes) But still timeout error is coming Seeism seeism wrote: > > it is 1*512 bytes > but my cmd is only 6 bytes.So do i need to put 0 for other byters and send > it?? > > On 7/15/08, Lei Chen <Ray...@su...> wrote: >> seeism wrote: >> > Hi, >> > >> > I am trying to send 6 byte commands to my usb printer.Write succeds but >> read >> > fails and gives timeout error.What could be the reason. >> > >> > >> What's the endpoint's wMaxPacketSize of your device? Try to read/write >> the >> wMaxPacketSize bytes of data. >> >> Regards, >> Lei Chen >> >> >> >> > >> > My code is >> ret=usb_bulk_write(usb_handle,0x02,&bulkwrite,sizeof(bulkwrite),5000); >> > ret >> =usb_bulk_read(usb_handle,0x81,&bulkread,sizeof(bulkread),5000); >> > printf("Return value of read is %d %s \n",ret,usb_strerror()); >> > >> > Output is >> > -110 No error >> > >> > >> > I am using fedora 8 with kernel 2.6.25 >> > >> > regards, >> > seeism >> > >> > >> >> > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Libusb-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > > -- View this message in context: http://www.nabble.com/usb_bulk_read-gives-timeout-error-tp18459722p18460742.html Sent from the LibUSB Dev mailing list archive at Nabble.com. |