From: Antonio Ospite <ospite@studenti.unina.it>
To: Alan Ott <alan@signal11.us>
Cc: Jiri Kosina <jkosina@suse.cz>, linux-input@vger.kernel.org
Subject: Re: [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw
Date: Thu, 30 Sep 2010 01:51:04 +0200 [thread overview]
Message-ID: <20100930015104.49fc5acf.ospite@studenti.unina.it> (raw)
In-Reply-To: <1281990059-3562-2-git-send-email-alan@signal11.us>
[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]
On Mon, 16 Aug 2010 16:20:58 -0400
Alan Ott <alan@signal11.us> wrote:
> Per the HID Specification, Feature reports must be sent and received on
> the Configuration endpoint (EP 0) through the Set_Report/Get_Report
> interfaces. This patch adds two ioctls to hidraw to set and get feature
> reports to and from the device. Modifications were made to hidraw and
> usbhid.
>
> New hidraw ioctls:
> HIDIOCSFEATURE - Perform a Set_Report transfer of a Feature report.
> HIDIOCGFEATURE - Perform a Get_Report transfer of a Feature report.
>
> Signed-off-by: Alan Ott <alan@signal11.us>
> ---
Some more testing with sixaxis and a question:
HIDIOCGFEATURE on report 0xf5 returns:
<-- 01 00 00 03 c9 87 34 fd
^^ a hw addr from here
with the latest six octets being a hw addr; now if I wanted to change
this, *naively*, I'd send this report with HIDIOCSFEATURE:
--> f5 01 00 66 55 44 33 22 11
^^ report ID _added_ in front of the whole previous buffer
but then when I get the report again to see if the operation succeeded I
get:
<-- 01 00 00 66 55 44 33 22
I can make it work if I send:
--> f5 00 66 55 44 33 22 11
^^ report ID _replaced_ buf[0]
then I get the expected:
<-- 01 00 66 55 44 33 22 11
Am I missing something about the differences about getting a feature
report and setting it?
In the HIDIOCGFEATURE doc I read:
...
The report will be returned starting at
the first byte of the buffer (ie: the report number is not
returned).
Someone (/me whistling, with hands in pockets) could interpret this
like a buf++ semantic on a quick read, even if this sentence means
"only" that _actual_data_ is from buf[1]; but one question stands: what
is that value returned in buf[0]? Is this unspecified?
Maybe the doc could be made even more explicit about buf[0] to overcame
non native speakers deficiencies.
And while at it, can we get rid of the ambiguity of "first byte" for
"byte 1", the former can even mean buf[0], can't it?
Thanks,
Antonio
--
Antonio Ospite
http://ao2.it
PGP public key ID: 0x4553B001
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-09-29 23:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1281442367.12579.206.camel@localhost.localdomain>
2010-08-16 20:20 ` [PATCH v4 0/2] Get and Set Feature Reports on HIDRAW (USB and Bluetooth) Alan Ott
2010-08-16 20:20 ` [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw Alan Ott
2010-08-16 20:20 ` [PATCH v4 2/2] Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE Alan Ott
[not found] ` <1281990059-3562-1-git-send-email-alan@signal11.us>
2010-08-23 13:00 ` [PATCH v4 0/2] Get and Set Feature Reports on HIDRAW (USB and Bluetooth) Jiri Kosina
2010-09-02 15:25 ` Jiri Kosina
2010-09-22 12:09 ` Jiri Kosina
2010-11-01 19:23 ` Jiri Kosina
[not found] ` <alpine.LNX.2.00.1011011523150.15851-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2010-11-08 11:17 ` Antonio Ospite
[not found] ` <1281990059-3562-1-git-send-email-alan-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-09-23 16:25 ` Ville Tervo
2010-09-23 17:07 ` Ping Cheng
[not found] ` <AANLkTinJXYbZh_MvG81iJMu84LKBOKL3s-Gbfe77Vq7q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-23 20:16 ` Przemo Firszt
2010-09-23 23:40 ` Alan Ott
[not found] ` <1281990059-3562-3-git-send-email-alan@signal11.us>
[not found] ` <1281990059-3562-3-git-send-email-alan-yzvJWuRpmD1zbRFIqnYvSA@public.gmane.org>
2010-09-23 11:51 ` [PATCH v4 2/2] Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE Ville Tervo
2010-09-23 14:16 ` Alan Ott
2010-09-24 10:47 ` Antonio Ospite
[not found] ` <1281990059-3562-2-git-send-email-alan@signal11.us>
2010-09-28 13:30 ` [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw Antonio Ospite
[not found] ` <20100928153011.32750e5d.ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
2010-10-01 13:30 ` Jiri Kosina
2010-09-29 23:51 ` Antonio Ospite [this message]
2010-09-30 3:37 ` Alan Ott
2010-09-30 22:03 ` Antonio Ospite
2010-10-02 0:00 ` Antonio Ospite
2010-10-02 2:24 ` Alan Ott
2010-10-02 0:30 ` Alan Ott
2010-10-02 7:50 ` Antonio Ospite
2010-10-04 13:37 ` Alan Ott
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=20100930015104.49fc5acf.ospite@studenti.unina.it \
--to=ospite@studenti.unina.it \
--cc=alan@signal11.us \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/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).