On Thu, 27 Apr 2006, Jamie Guinan wrote:

> Hi,
> 
> I'm trying to talk to a Canon PowerShot A520 via libptp, which uses 
> libusb.  The "ptpcam" app works once, then fails after that until I 
> dis/re-connect the camera.
> 
>     open("/proc/bus/usb/001/002", O_RDWR)   = 3
>     ioctl(3, USBDEVFS_CLAIMINTERFACE, 0xbe810c64) = 0
>     ioctl(3, UI_DEV_DESTROY or USBDEVFS_BULK, 0xbe8109d4) = 16
>     ioctl(3, UI_DEV_DESTROY or USBDEVFS_BULK, 0xbe8109c4) = -1 ETIMEDOUT 
> (Connection timed out)
>     write(2, "ERROR: Could not open session!\nT"..., 56ERROR: Could not open 
> session!
>     Try to reset the camera.
>     ) = 56
>     ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbe810c68) = 0
> 
> I haven't figured out why it behaves like this, but I'm looking at 
> usbsnoop logs to try and figure out how what the problem is.  And I 
> found this in the logs,
> 
> <snippet>
> [1796 ms]  >>>  URB 6 going down  >>> 
> -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
>   PipeHandle           = 85bcfe14 [endpoint 0x00000081]
>   TransferFlags        = 00000002 (USBD_TRANSFER_DIRECTION_OUT, 
> USBD_SHORT_TRANSFER_OK)
>   TransferBufferLength = 00000040
>   TransferBuffer       = 85d0da98
>   TransferBufferMDL    = 00000000
>     00000000: 00 00 00 00 00 10 00 00 00 f0 98 02 00 00 00 00
>     00000010: e8 e6 67 85 b0 1a 5f 85 00 00 99 02 00 00 00 00
>     00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>     00000030: 00 00 00 00 00 00 00 00 d8 1a 5f 85 10 e7 67 85
>   UrbLink              = 00000000
> [1807 ms] UsbSnoop - MyInternalIOCTLCompletion(f799fdb0) : 
> fido=85c8e0d0, Irp=85cc5ab0, Context=862edfa8, IRQL=2
> [1807 ms]  <<<  URB 6 coming back  <<< 
> -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
>   PipeHandle           = 85bcfe14 [endpoint 0x00000081]
>   TransferFlags        = 00000003 (USBD_TRANSFER_DIRECTION_IN, 
> USBD_SHORT_TRANSFER_OK)
>   TransferBufferLength = 0000000c
>   TransferBuffer       = 85d0da98
>   TransferBufferMDL    = 85c8ad90
>     00000000: 0c 00 00 00 03 00 01 20 00 00 00 00
>   UrbLink              = 00000000
> </snippet>
> 
> What puzzles me is that TransferFlags is USBD_TRANSFER_DIRECTION_OUT 
> going down, and USBD_TRANSFER_DIRECTION_IN coming up.  Is this valid?

It's hard to say what is valid when you're talking about Windows.  :-)

Regardless, the endpoint number is 0x81, which means it is an IN endpoint.  
So the transfer was definitely IN to the computer from the device.

> If so, what would be the corresponding libusb call, usb_bulk_write or 
> usb_bulk_read?

The corresponding call is usb_bulk_read.

Alan Stern



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to