From owner-freebsd-current@FreeBSD.ORG Thu Sep 9 07:00:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1165C10656AC for ; Thu, 9 Sep 2010 07:00:52 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3018FC17 for ; Thu, 9 Sep 2010 07:00:51 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=Nfp3MZa29RopV9PSMgo46OtSaaUquDJpaM5eTxVUGhg= c=1 sm=1 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=FFco8cedzDY532IaSpMA:9 a=BAcFWgyJ-8klfLJlvR_54vgGWcUA:4 a=wPNLvfGTeEIA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:117 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 18336923; Thu, 09 Sep 2010 09:00:26 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Thu, 9 Sep 2010 08:56:48 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009090856.48132.hselasky@c2i.net> Cc: Maksim Yevmenkin Subject: Re: silly libusbhid question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 07:00:52 -0000 On Wednesday 08 September 2010 20:57:50 Maksim Yevmenkin wrote: > hello, > > [trying current@ first to get wider audience :)] > > so, i have a somewhat silly question about libusbhid. please consider > the following code > > hid_data_t d; > hid_item_t h; > > for (d = hid_start_parse(desc, 1 << hid_input, -1); hid_get_item(d, &h) > > 0; ) { ... > } > hid_end_parse(d); > > the idea is/was to parse and iterate over hid descriptor desc in a > such a way that only "hid_input" items are returned. as it turns out, > this code will also pick up "hid_collection" items as well, i.e. > "h.kind" is set to "hid_collection". is this a bug or a feature? > > thanks, > max In kernel and userspace this is currently a feature in the HID libraries. --HPS