Author Topic: HID - Long Items  (Read 10913 times)

Nik

  • Member
  • ***
  • Posts: 40
HID - Long Items
« on: July 25, 2013, 12:03:35 pm »
Hello,

I am implementing a USB HID to communicate with a testing terminal ( generally a laptop).

The functionality includes :
  -> Transferring real time data (few bytes each transfer)
  -> Transferring error log files (large files)
  -> Transferring firmware update files (very large files)

It could have been implemented by using HID class and Control Transfer for real time data, Mass Storage Class and Bulk Transfer for large files.

But to reduce the code size and efforts, I am thinking of using the 'Long Item'  to transfer large files.

Am I thinking correctly ? What will be the challenges ?

Regards,
Nik

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID - Long Items
« Reply #1 on: July 25, 2013, 09:59:15 pm »
In Get_Report and Set_Report requests, which the host can use to request and send reports, the report length field is two bytes, which limits reports to 65,535 bytes.

You could send the files in pieces. However, transferring large amounts of data using interrupt or control transfers will be very slow compared to using bulk transfers.


Nik

  • Member
  • ***
  • Posts: 40
Re: HID - Long Items
« Reply #2 on: July 26, 2013, 12:31:12 am »
Thank you very much for the response Jan !

USB Development would have been impossible without your books !

A few more points about the implementation :
 -> using a full speed host.
 -> using Bulk-only-transport

Full speed implementation using Bulk transfer puts limitation of 64 Bytes per frame. While if I use Long Items in Control transfer, I can have 255 bytes per frame.

Am I missing something ?

Thanks in advance.

Regards,
Nik

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID - Long Items
« Reply #3 on: July 26, 2013, 09:48:06 am »
For both bulk transfers and the Data stage of control transfers, full speed supports up to 64 bytes per transaction. The host can schedule multiple transactions per frame.