From owner-freebsd-usb@FreeBSD.ORG Sun Jun 7 14:16:44 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA99A106566B for ; Sun, 7 Jun 2009 14:16:44 +0000 (UTC) (envelope-from ccna.syl@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by mx1.freebsd.org (Postfix) with ESMTP id 8751B8FC1C for ; Sun, 7 Jun 2009 14:16:44 +0000 (UTC) (envelope-from ccna.syl@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so1470412ywe.13 for ; Sun, 07 Jun 2009 07:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=EP1vu9KYYtYfsLQ7NWl8M6q/n589K2Jy1Wv2lMa+T+4=; b=rm154C3HNJSE6bRR53aTyhv1sfjRnNwJVJvYKPOF1YDVM1VzTNO48qa6CQcTN9I/nI K3GyXxr5O3PKYmKfwwGehuMhb6jG//DZYx5qQHWmkKlT+S011oxr1NwiSW0hPvbkW8CM AQdc/Pp2wii6psOldjO6srRFa4ZTWZDcy4d4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=QO0TFirrXilMqa/SwtZRrz9aiXgmySH0K54rLDbUKhu4k5TfGFtiB8CCnv8RJlXp3f bfGUH8yuxXwX/3mHocaicbfCIa5KoojhHyzgd68/tH9Z6v1G5nQ+9nquVLzKKJBQgGIt fES9Kt5dnu5Qrt+QBwXCtonF65YBcYfAQuyDk= MIME-Version: 1.0 Received: by 10.231.18.140 with SMTP id w12mr1467994iba.55.1244382538194; Sun, 07 Jun 2009 06:48:58 -0700 (PDT) In-Reply-To: <4A2B29C0.7020709@twilley.org> References: <4A2B29C0.7020709@twilley.org> From: Sylvestre Gallon Date: Sun, 7 Jun 2009 15:48:38 +0200 Message-ID: <164b4c9c0906070648gb7abd54o967c2daebf6e8032@mail.gmail.com> To: Jack Twilley Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-usb@freebsd.org Subject: Re: How to retrieve iManufacturer/iProduct information from libusb20? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 14:16:45 -0000 On Sun, Jun 7, 2009 at 4:45 AM, Jack Twilley wrote: > I have been looking through the source to usbconfig and other tools tryin= g > to figure out how to retrieve the iManufacturer and iProduct strings. =A0= The > libusb20 man page describes the libusb20_dev_get_device_desc() function b= ut > there's no useful information on the struct it returns. =A0The include fi= le > looks as if the struct is automagically generated by macros within macros > which is too complicated for me to figure out without help. =A0Any ideas? > =A0There's gotta be a better way than using LIBUSB20_DEVICE_DESC()... > > Jack. You can use the function libusb20_dev_get_device_desc() that returns a struct LIBUSB20_DEVICE_DESC_DECODED *. The field idVendor and idProduct in the struct LIBUSB20_DEVICE_DESC_DECODED are what you are looking for :) Cheers, --=20 Sylvestre Gallon (http://devsyl.blogspot.com) Fifth Grade Student @ Epitech & Researcher @ LSE R&D @ Rathaxes (http://www.rathaxes.org)