Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Jun 2009 10:16:27 -0700
From:      Jack Twilley <jmt@twilley.org>
To:        Sylvestre Gallon <ccna.syl@gmail.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: How to retrieve iManufacturer/iProduct information from libusb20?
Message-ID:  <4A2D476B.20100@twilley.org>
In-Reply-To: <164b4c9c0906070648gb7abd54o967c2daebf6e8032@mail.gmail.com>
References:  <4A2B29C0.7020709@twilley.org> <164b4c9c0906070648gb7abd54o967c2daebf6e8032@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sylvestre Gallon wrote:
> On Sun, Jun 7, 2009 at 4:45 AM, Jack Twilley<jmt@twilley.org> 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()...
>>
>> 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 :)

idVendor and idProduct look good according to the output of usbconfig, 
but whenever I try to refer to ddesc->idVendor (or anything else in that 
structure) I get "error: dereferencing pointer to incomplete type". 
This is what sent me looking through the includes for the actual type 
definition.

Other than the usbconfig code that uses the LIBUSB20_DEVICE_DESC() 
macro, is there any other example code out there that does what I'm 
trying to do?

> 
> Cheers,
> 

Thanks!

Jack.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A2D476B.20100>