From owner-freebsd-usb@FreeBSD.ORG Sun Jun 7 23:05:32 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 3DBEA1065677 for ; Sun, 7 Jun 2009 23:05:32 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swip.net [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id C9CEB8FC23 for ; Sun, 7 Jun 2009 23:05:31 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=W-YcfUTv09kA:10 a=1qBssEImBScA:10 a=MXw7gxVQKqGXY79tIT8aFQ==:17 a=SMv5QZfTtRfnK2bZIEAA:9 a=UYrs_QFNNwLR2AAdcLe4OwmropIA:4 Received: from [62.113.132.61] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1082693632; Mon, 08 Jun 2009 01:05:29 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Mon, 8 Jun 2009 00:30:50 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-CURRENT; KDE/4.2.4; i386; ; ) References: <4A2B29C0.7020709@twilley.org> In-Reply-To: <4A2B29C0.7020709@twilley.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906080030.53822.hselasky@c2i.net> Cc: Jack Twilley 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 23:05:32 -0000 On Sunday 07 June 2009 04:45:20 Jack Twilley wrote: > I have been looking through the source to usbconfig and other tools > trying to figure out how to retrieve the iManufacturer and iProduct > strings. The libusb20 man page describes the > libusb20_dev_get_device_desc() function but there's no useful > information on the struct it returns. The include file looks as if the > struct is automagically generated by macros within macros which is too > complicated for me to figure out without help. Any ideas? There's > gotta be a better way than using LIBUSB20_DEVICE_DESC()... After you find the string index, you can use the following function to get strings: int libusb20_dev_req_string_simple_sync(struct libusb20_device *pdev, uint8_t index, void *ptr, uint16_t len); --HPS