Author Topic: Winusb_readpipe  (Read 10893 times)

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Winusb_readpipe
« on: October 21, 2013, 03:46:28 am »
Hello,

I am trying to read data through bulk in on a custom keyboard(Inputs are some buttons and volume adjustment scrolls).
I am using winusb cs sample provided by lvr for the same. When i try it on a hp printer it shows me some string in bulk input but when same code I use for my keyboard it shows me nothing "success=false" in reading bulk inputs.

what am I missing?? are any specifications needed?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #1 on: October 21, 2013, 09:45:05 am »
Keyboards are normally HID-class devices, which can use control and interrupt endpoints only. Does your custom keyboard have an interface with a bulk IN endpoint?

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #2 on: October 25, 2013, 03:39:49 am »
Yes I have endpoints with bulkin and bulkout. its a input device.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #3 on: October 25, 2013, 10:07:21 am »
The bulk endpoints must be in a non-HID interface. Are they?

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #4 on: October 26, 2013, 02:03:10 am »
I did not get you? please explain... actually I am new to this stuff

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #5 on: October 26, 2013, 12:36:48 pm »
I missed that you're using WinUSB.

Use whatever debugging tools you have to find out why the application isn't seeing the data.

A USB protocol analyzer will show what is happening on the bus.

In Visual Studio, use breakpoints and/or single stepping to examine variables, etc. where the transfer fails.

Use whatever debugging tools you have for your firmware to find out how the endpoint is responding to IN token packets.

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #6 on: October 28, 2013, 03:15:54 am »
Is there any specific need to read data through bulk????? coz the same code is working with printer and not with my custom device~

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #7 on: October 28, 2013, 03:21:11 am »
and Can I use Isochronous tranfer with Winusb?? on windows 7?? If yes you have some sample code??

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #8 on: October 28, 2013, 10:04:27 am »
WinUSB doesn't support isochronous transfers. If your device is vendor-defined, you can use any transfer type the host driver supports.

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #9 on: October 30, 2013, 07:36:26 am »
Device have 4 endpoints two bulk and two isochronous can I use winusb for this kind of device?? Is it possible to have all trafers with help of bulk endpoints and not to use isochronous??

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #10 on: October 30, 2013, 11:07:24 am »
Whether your device can work using only bulk endpoints depends entirely on the device function - what the device needs to accomplish.

mayank07bagaria

  • Member
  • ***
  • Posts: 7
Re: Winusb_readpipe
« Reply #11 on: October 31, 2013, 08:22:16 am »
Device need to pass some values with help of some volume control buttons and sort of keys which passes commands to DC motors to be operated on.

Is there a possibility that some specific key let say X key transfers using Bulk and Y key tranfers using Isochronous?? This info is provided by manufaturer Or it purely depends on the driver???

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Winusb_readpipe
« Reply #12 on: October 31, 2013, 09:38:28 am »
The driver and sometimes the application software define what transfer types are used and what for.

Isochronous is intended for real-time audio and video. It would be very unusual to use isochronous to read a button or key. Interrupt transfers are the most common for this, but bulk could work also.