Ports
May 18, 2013, 01:50:40 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: Send USB Control Tranfer in User-mode  (Read 3898 times)
androjes
Member
*
Posts: 6


« on: January 13, 2011, 01:20:03 pm »

Hello every body.
My goal is to send control transfer (specific command) to the device which is managed by the usbvideo.sys driver (UVC).
After long research, I've saw 2 solutions:
1- Using libusb as upper filter driver. it works well but my problem is how to include libusb-filter in the INF file as the upper filter above the usbvideo.sys?
2- I plan to use DeviceIOControl but I don't really know what code control to use?

Could someone give me one working sample or some help.v

Thanks...
Logged
androjes
Member
*
Posts: 6


« Reply #1 on: January 14, 2011, 06:09:14 am »

No answer.

Does someone know how to send URB request (UsbBuildVendorRequest) from user mode with C#.NET.

Thanks
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1624


WWW
« Reply #2 on: January 14, 2011, 10:34:57 am »

The libusb forum is probably a better place for advice specific to libusb. If you're using a vendor-defined driver, you define the DeviceIoControl codes as allowed by the driver's API.

Jan
Logged
androjes
Member
*
Posts: 6


« Reply #3 on: January 14, 2011, 01:23:11 pm »

I'm using the usbvideo.sys video class driver (provided by windows).
So I don't know what control code to use  Cry. I want to use "USBUSER_OP_SEND_RAW_COMMAND" but i's not documented Someone else have a sample of this?

Thanks.
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1624


WWW
« Reply #4 on: January 14, 2011, 05:10:05 pm »

It's documented here:

http://msdn.microsoft.com/en-us/library/ff537344%28VS.85%29.aspx

USBUSER_OP_SEND_RAW_COMMAND
Do not use this request.

What are you trying to accomplish on the video device?

Jan
Logged
androjes
Member
*
Posts: 6


« Reply #5 on: January 15, 2011, 03:03:53 pm »

>It's documented here:
>http://msdn.microsoft.com/en-us/library/ff537344%28VS.85%29.aspx
>USBUSER_OP_SEND_RAW_COMMAND
>Do not use this request.


The documentation is not enough. Even Windows don't recommend to use this request. The format of data (after the HEADER) is not defined.

>What are you trying to accomplish on the video device?
I just want to send a control transfer (EP0) through video class driver (usbvideo.sys).
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1624


WWW
« Reply #6 on: January 15, 2011, 04:52:04 pm »

>I just want to send a control transfer (EP0) through video class driver (usbvideo.sys).

For what purpose? Maybe you can accomplish the same thing at a higher level with DirectShow.

Jan
Logged
androjes
Member
*
Posts: 6


« Reply #7 on: January 15, 2011, 06:00:06 pm »

>For what purpose? Maybe you can accomplish the same thing at a higher level with DirectShow.
I want to send vendor command to my device (access to register of sensor). So I don't think that directshow can do that  Huh
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1624


WWW
« Reply #8 on: January 16, 2011, 12:08:50 am »

If it's a vendor-defined command, you need to provide a vendor-defined driver to support it.

Jan
Logged
androjes
Member
*
Posts: 6


« Reply #9 on: January 18, 2011, 05:18:00 am »

>If it's a vendor-defined command, you need to provide a vendor-defined driver to support it.
I couldn't develop a driver like usbvideo.sys. I just want to extend its functionality which can allow to send control transfer from user space.
My last solution is installing "libusb-win32" as filter driver of usbvideo.sys and I'll use LibUsBDotNet for sending control transfer from my application.
My problem now is to write the corresponding INF file  Huh  Huh  Huh

Thanks Jan.
Logged
xiaofan
Member
*
Posts: 2


« Reply #10 on: January 28, 2011, 02:00:33 am »

If you download the latest libusb-win32 release, you can use the GUI filter wizard to install the filter driver to that specific device. You do not need an inf file.

Take note that libusb-win32 filter may not work with some device and according to some driver experts that it has no future. BTW, I am one of the admins of libusb-win32 project.

The other way is to change the firmware and have one extra interface without any endpoints. Use WinUSB (or libusb-win32 device driver) for that interface for the vendor specific control transfer.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!