linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Ott <alan@signal11.us>
To: Xiaofan Chen <xiaofanc@gmail.com>
Cc: Antonio Ospite <ospite@studenti.unina.it>,
	Amit Nagal <helloin.amit@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-usb@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: Report ID problem with HID-RAW interface usage
Date: Wed, 30 Jun 2010 10:10:03 -0400	[thread overview]
Message-ID: <4C2B503B.7020209@signal11.us> (raw)
In-Reply-To: <AANLkTimpiuADYMRmPNWO_qWjQj1LKyjmh3JncuK9Fa4I@mail.gmail.com>

On 06/30/2010 10:02 AM, Xiaofan Chen wrote:
> On Wed, Jun 30, 2010 at 9:13 PM, Antonio Ospite
> <ospite@studenti.unina.it>  wrote:
>    
>> One of the advantages in the usb case is that you do not have to
>> _detach_ the kernel driver bound to the device in order to set/get
>> raw hid reports. With libusb this is needed.
>>
>>      
> To me this is not that much an advantage. Actually libusb-1.0
> has the API to re-attach the kernel driver under Linux. And we make
> use of this in the new libusb-1.0 example program xusb.
> http://libusb.sourceforge.net/api-1.0/group__dev.html#ga9de769d3aeb45a07f5559c8a0597cbcc
> http://git.libusb.org/?p=libusb-pbatard.git;a=blob;f=examples/xusb.c;h=e260153aa50234f1c994db521969b7f0e84aebb6;hb=HEAD
>    

Another advantage of hidraw is that the API does not depend on the 
transport. As Jiri said, it supports multiple hardware types, but beyond 
that, one does not have to worry about whether to send data over the 
control endpoint vs. interrupt endpoints, whether the report number gets 
added properly (in theory, when there aren't bugs :) ), etc.

The theory is that one can throw data at hidraw using simple read() and 
write() commands, and it comes out on the device side, without the 
client program having to know too much about USB or Bluetooth.

That's an advantage to me anyway. It's true that libusb is more flexible 
for USB devices as it handles custom class, and non-HID class devices, 
and can send data on any endpoint directly. The HID is supposed to be a 
simplified interface (limited endpoints, well-structured data, etc), so 
it makes sense to have a simplified API to communicate with it.

Think of hidraw as analogous to the Windows hid.dll API. The concepts 
are similar.

Alan.



  reply	other threads:[~2010-06-30 14:10 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 11:10 Report ID problem with HID-RAW interface usage Amit Nagal
     [not found] ` <AANLkTinrmRsB39gj7Ie4xCr3fhP3jU1dfYuVrkiKv347-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 16:30   ` Alan Ott
2010-06-29 23:32     ` Xiaofan Chen
2010-06-30  7:39       ` Amit Nagal
2010-06-30  7:56         ` Amit Nagal
2010-06-30  7:57           ` Jiri Kosina
     [not found]     ` <4C2A1FA0.6020704-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-06-30  9:26       ` Jiri Kosina
2010-06-30 10:30         ` Amit Nagal
     [not found]           ` <AANLkTilf1JU_GPlqE-FeaRon6IMqgA68WZ964PJfLpSP-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-30 10:55             ` Jiri Kosina
2010-06-30 11:14               ` Amit Nagal
2010-06-30 12:54                 ` Alan Ott
2010-06-30 13:04                   ` Xiaofan Chen
2010-06-30 13:06                     ` Jiri Kosina
2010-06-30 14:09                       ` Xiaofan Chen
     [not found]                         ` <AANLkTil0S747k-MomthJW4dv2WwB-abjZmGmxf3fH59y-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-30 14:32                           ` Alan Ott
2010-06-30 23:33                             ` Xiaofan Chen
2010-06-30 13:13                     ` Antonio Ospite
2010-06-30 14:02                       ` Xiaofan Chen
2010-06-30 14:10                         ` Alan Ott [this message]
2010-06-30 14:16                         ` Antonio Ospite
2010-06-30 16:40                   ` Amit Nagal
     [not found]                     ` <AANLkTimb_xMYTZYAm51lmHEkYvrvegwbmkUyJldxYA-f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-01  2:40                       ` Xiaofan Chen
2010-07-01 13:16                       ` Alan Ott
2010-07-02  6:46                         ` Amit Nagal
     [not found]                           ` <AANLkTilFyRjuP4VUmJolYhloDol5B7HsYV9d5SD8vZPo-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-02 15:05                             ` Alan Ott
     [not found]                               ` <4C2E0057.30206-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-07-02 16:19                                 ` Amit Nagal
     [not found]               ` <alpine.LNX.2.00.1006301252380.13809-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2010-06-30 12:32                 ` Alan Ott
     [not found]                   ` <4C2B3956.6080107-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-06-30 12:38                     ` Jiri Kosina
2010-06-30 13:50         ` [PATCH 0/1] HID: Send Report ID when numbered reports are sent over the control endpoint Alan Ott
2010-06-30 13:50         ` [PATCH 1/1] " Alan Ott
     [not found]           ` <1277905836-3949-2-git-send-email-alan-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-07-11 21:14             ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2B503B.7020209@signal11.us \
    --to=alan@signal11.us \
    --cc=helloin.amit@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ospite@studenti.unina.it \
    --cc=xiaofanc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).