Author Topic: Simple newbie question  (Read 6711 times)

Krcevina

  • Member
  • ***
  • Posts: 3
Simple newbie question
« on: December 27, 2012, 09:25:36 am »
Hi!

I just need answer on this simple question.

Why do I need HID descriptor? All I need is raw data that I send from my remote device to the host. I choose what I want to sent. For example 5 bytes. 1st byte low 8 bits of X position, 2nd byte high 8 bits of Y position, 3th and 4th for Y position and lets say 5th for state of buttons. When I receive that packet of bytes I do later whatever I want (raise events in my kernel...). Why do I need HID descriptor? My driver just runs through it and check if everything is okay. Bam! Nothing more... Those bunch of bytes in my HID descriptor are of none use to me. It is obvious that I'm missing some crucial knowledge but what?

Hopefully someone will find a 5 min to answer this question.

Thanks.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Simple newbie question
« Reply #1 on: December 27, 2012, 10:32:08 am »
The HID class by definition transfers data in reports of defined size and type so the HID descriptor at minimum must tell the host the type and length of the reports the device supports. All of the data can be vendor-defined.

If you want to transfer generic data of any length, use a USB virtual serial port or a generic driver such as WinUSB or libusb.