A timeout on a 5 byte buffer is almost certainly because the device has
nothing to send yet :)

You can workaround it by using the usb_submit_urb interface and giving a
timeout of 0.

The URB will never timeout then and just sit there waiting for data to
arrive.

Look at the USB server drivers, usbnet, USB ethernet drivers, etc for
examples.

JE

On Tue, Dec 03, 2002, Roger Hosto <[EMAIL PROTECTED]> wrote:
> The buffer is only 5 bytes. I think the problem is, that it is not 
> always receiving data. It just receives data when someone sends a 
> signal, but I need to be constantly reading the device for when they do 
> send a signal. That's my problem I not sure if I am going about this 
> read function the best way. I am  kind of guessing. 8)
> 
> Johannes Erdfelt wrote:
> 
> >How big is the buffer you're reading?
> >
> >Are you sure there is data to be read from the device?
> >
> >Can you try HZ * 4 (or larger)?
> >
> >JE
> >
> >On Tue, Dec 03, 2002, Roger Hosto <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>Okay I add in HZ*2 it decreased the number of error messages, but I am 
> >>still getting.
> >>kernel: usb_control/bulk_msg: timeout
> >>
> >>Thanks,
> >>Roger Hosto.
> >>
> >>Johannes Erdfelt wrote:
> >>
> >>    
> >>
> >>>On Tue, Dec 03, 2002, Roger Hosto <[EMAIL PROTECTED]> wrote:
> >>> 
> >>>
> >>>      
> >>>
> >>>>Okay I am a novice in hardware programming, but I have always heard and 
> >>>>readed that if there is something you want in linux and no one else has 
> >>>>done it try it yourself. So I did.
> >>>>
> >>>>Here is my problem. I am writing a usb driver for x10 cm19a usb Wireless 
> >>>>Transceiver. It is a simple device that tranmits and receive X10 
> >>>>protocols. I have got everything working accept I have a problem with 
> >>>>the read control.
> >>>>Here is what I have tried.
> >>>>
> >>>>
> >>>>   /* do an immediate bulk read to get data from the device*/
> >>>>   retval = usb_bulk_msg (dev->udev,
> >>>>                  usb_rcvbulkpipe (dev->udev, dev->bulk_in_endpointAddr),
> >>>>                  dev->bulk_in_buffer,
> >>>>                  dev->bulk_in_size,
> >>>>                  &count,
> >>>>                  dev->bulk_in_bInterval*2);//increased by a factor of 
> >>>>2 to improve data received
> >>>>
> >>>>This works fine, but I receive the following error
> >>>>kernel: usb_control/bulk_msg: timeout
> >>>>
> >>>>So I tried the following to get rid of the error. which works but it 
> >>>>jacks my Processor up to 100%.
> >>>> 
> >>>>   /* check and make sure that read hasn't been submit yet*/
> >>>>   if(dev->read_urb->status == 0 ||
> >>>>      dev->read_urb->status == -ENOENT)
> >>>>   {
> >>>>       usb_fill_int_urb(dev->read_urb,
> >>>>                    dev->udev,
> >>>>                    usb_rcvbulkpipe(dev->udev,dev->bulk_in_endpointAddr),
> >>>>                     dev->bulk_in_buffer,
> >>>>                     count,
> >>>>                     cm19a_read_bulk_callback,
> >>>>                     dev,
> >>>>                    dev->bulk_in_bInterval);
> >>>>
> >>>>       retval = usb_submit_urb(dev->read_urb);
> >>>>   }
> >>>> 
> >>>>Any help would be cool.
> >>>>I am using  Linux 2.4.18-3 #1 Thu Apr 18 07:32:41 EDT 2002 i686 unknown
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>Don't use bInterval on a bulk pipe.
> >>>
> >>>Just use a fixed time, like HZ or HZ * 2 for the timeout.
> >>>
> >>>JE
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>-- 
> >>Your favorite stores, helpful shopping tools and great gift ideas. 
> >>Experience the convenience of buying online with Shop@Netscape! 
> >>http://shopnow.netscape.com/
> >>
> >>    
> >>
> 
> -- 
> Your favorite stores, helpful shopping tools and great gift ideas. 
> Experience the convenience of buying online with Shop@Netscape! 
> http://shopnow.netscape.com/
> 
> 


-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to