Author Topic: Send/Receive custom usb cmd ?  (Read 9761 times)

Polaris

  • Member
  • ***
  • Posts: 2
Send/Receive custom usb cmd ?
« on: August 17, 2014, 05:18:05 pm »
Hi USB experts:

I have a customer who store their own customize info in their controller and can be retrieved using usb command in format like this: host to device: byte1, byte2, byte3, byte4. I have a few things hope you can help me to understand:

1. In my WDF kernel driver which type of the USB operation should I use: USB standard command? Vendor command or Class command ?
2.  I guess I will have to use WDF API WDF_USB_CONTROL_SETUP_PACKET_INIT (_VENDOR/_CLASS). What value should I use for "Value" and "Index" ?
3.  Can a user mode application send/receive such USB command without using the WinUsb lib (like those HidP_ or HidD_ APIs) ?
If possible please offer your help with some details (not a single line answer).
Thanks in advance.
Polaris

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Send/Receive custom usb cmd ?
« Reply #1 on: August 17, 2014, 09:12:39 pm »
If you don't want to write a driver and don't want to use the WinUSB API, a vendor-defined HID-class device can send and receive vendor-defined data using control and/or interrupt transfers.

I have example code here:

http://janaxelson.com/hidpage.htm


Polaris

  • Member
  • ***
  • Posts: 2
Re: Send/Receive custom usb cmd ?
« Reply #2 on: August 18, 2014, 04:03:57 am »
Thanks Jan. I do have my own WDF usb filter driver...