Author Topic: Data from host to HID device  (Read 121 times)

sd

  • Member
  • ***
  • Posts: 3
Data from host to HID device
« on: October 04, 2018, 06:25:57 pm »
Hello,

I am using the following HID descriptor for my BLE HID device. I also tried using the vendor defined page as mentioned in your book - USB Complete

Code: [Select]
0x05, 0x03, // USAGE_PAGE(VR Controls)
  0x09, 0x04, // USAGE (Glove)
  0xA1, 0x01, // COLLECTION (Application)
    0x85, 0x01, // REPORT_ID(1)
  0x09, 0x04, // USAGE (Glove)
  0x15, 0x00, // LOGICAL_MINIMUM(0)
  0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM(255)
  0x75, 0x08, // REPORT_SIZE(8)
  0x95, 0x01, // REPORT_COUNT(1)
  0x81, 0x02, // INPUT(Data,Var,Abs)
  0x09, 0x04, // USAGE (Glove)
  0x15, 0x00, // LOGICAL_MINIMUM(0)
  0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM(255)
  0x75, 0x08, // REPORT_SIZE(8)
  0x95, 0x01, // REPORT_COUNT(1)
  0x91, 0x02, // OUTPUT(Data,Var,Abs)
  0xC0 // END COLLECTION

I am using SimpleHIDWrite utility to send/receive data. Please check attachments which include the results for GetReport, SetReport & Write. So why isnt the SetReport getting the correct handle? I am not able to locate where the problem is exactly.
« Last Edit: October 04, 2018, 07:00:17 pm by sd »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2742
    • Lakeview Research
Re: Data from host to HID device
« Reply #1 on: October 04, 2018, 08:18:29 pm »
Assuming Set Report is attempting to use a control transfer, are you sure the device supports receiving reports via control transfers?

A protocol analyzer would show what is happening on the bus.

sd

  • Member
  • ***
  • Posts: 3
Re: Data from host to HID device
« Reply #2 on: October 08, 2018, 07:33:41 pm »
Thank you Jan for your reply! I thought so that 'Set Report' might be using control transfer after reading your book! So now I will try to use a sniffer. But do you think host is able to send data to BLE device using "Write"?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2742
    • Lakeview Research
Re: Data from host to HID device
« Reply #3 on: October 08, 2018, 09:04:24 pm »
If the report descriptor includes at least one Output report, the host can use control transfers or interrupt transfers to send the reports to the HID.

Invalid handle suggests that the host was unable to attempt the transfer.

The error often has to do with permissions.

What are you trying to accomplish with the transfer? Is the device one you are designing or an off-the-shelf device?

sd

  • Member
  • ***
  • Posts: 3
Re: Data from host to HID device
« Reply #4 on: October 09, 2018, 02:46:48 pm »
Hi Jan,

I'm trying to design a product. I've successfully achieved the upstream communication but there is some problem with the downstream communication. So could you elaborate more on the permissions part? Is it that the API is not permitting to send data or my BLE device isnt accepting data? I wish to send haptic data from host to BLE device.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2742
    • Lakeview Research
Re: Data from host to HID device
« Reply #5 on: October 11, 2018, 11:14:12 pm »
The attachment doesn't show the host's detecting, or arrival, of the device.

Yet the handles for write, likely using interrupt transfers, and for get report, likely using control transfers, appear to work.

It's hard to troubleshoot what's happening on the host side if you don't have the source code.

Can you access the device using my HID example code?
« Last Edit: October 12, 2018, 03:41:22 pm by Jan Axelson »