LPIOC_GET_DEVICE_ID

bridged with qdn.public.ddk.usb
Post Reply
Lung Han

LPIOC_GET_DEVICE_ID

Post by Lung Han » Fri Nov 16, 2001 9:17 pm

Linux now is able to use the class-specific request to get device ID string.
Does QNX has the same functionality?

Thanks in advance for any feedback.

John Garvey

Re: LPIOC_GET_DEVICE_ID

Post by John Garvey » Fri Nov 16, 2001 9:22 pm

Lung Han <lhan@eitc.epson.com> wrote:
: Linux now is able to use the class-specific request to get device ID string.
: Does QNX has the same functionality?

You mean things like the vendor/device descriptions shown by "usb -v"?
Nothing class-specific about these, they are just string descriptors
(type 3). Use "usbd_string()" to obtain/parse these (the indices are in
the device descriptor) ...

: Thanks in advance for any feedback.

Lung Han

Re: LPIOC_GET_DEVICE_ID

Post by Lung Han » Fri Nov 16, 2001 10:07 pm

John, first thanks for your reply.

A printer can respond to two different types of requests:
1. standard USB device requests, which perform general functions for
supporting the bus and bus-related functions, such as, Get Descriptor, Get
Interface.
2. Class-specific requests, which cause the device to transfer command data
to or from the host, such as, GET_DEVICE_ID, GET_PORT_STATUS, SOFT_RESET.

The GET_DEVICE_ID will return a device ID string that is compatible with
IEEE 1284. The string is returned in the following format, IEEE 1284 device
ID string (including length in the first two bytes in big endian format.)

I tried this in redhat 7.0 and the stdout displays a long string to tell the
printer's name, manufacturer, etc. The usb -vvv, however, doesn't display
that kind of information.

I also check prn.c and prn.h included in UDDK and see no related codes.
Please correct me if I am wrong here.

Thanks again.

Best Regards,
lwh



"John Garvey" <jgarvey@qnx.com> wrote in message
news:9t4023$oj6$1@nntp.qnx.com...
Lung Han <lhan@eitc.epson.com> wrote:
: Linux now is able to use the class-specific request to get device ID
string.
: Does QNX has the same functionality?

You mean things like the vendor/device descriptions shown by "usb -v"?
Nothing class-specific about these, they are just string descriptors
(type 3). Use "usbd_string()" to obtain/parse these (the indices are in
the device descriptor) ...

: Thanks in advance for any feedback.

John Garvey

Re: LPIOC_GET_DEVICE_ID

Post by John Garvey » Fri Nov 16, 2001 11:36 pm

Lung Han <lhan@eitc.epson.com> wrote:
: and the stdout displays a long string to tell the printer's name
: manufacturer, etc. The usb -vvv, however, doesn't display

Are these strings in the string table, in the interface descriptor as a
vendor extension, or something that requires a data transfer command?

Unfortunately "usb" doesn't dump the entire string table (I should make
it do so). It will display embedded vendor descriptors with '-V'. You
can use usdb_parse_descriptors() (or the lower-level usbd_descriptor())
to obtain these all from code though.

Otherwise you can use usbd_setup_vendor() and usbd_io() with the
appropriate USB_TYPE_* / USB_RECIPIENT_* targetting to get this data
with an IO transfer.

Lung Han

Re: LPIOC_GET_DEVICE_ID

Post by Lung Han » Sat Nov 17, 2001 12:02 am

Thanks John,

I will try your idea and let you know what happens. Thanks and you have a
nice weekend.

lungwen
"John Garvey" <jgarvey@qnx.com> wrote in message
news:9t47tf$so6$1@nntp.qnx.com...
Lung Han <lhan@eitc.epson.com> wrote:
: and the stdout displays a long string to tell the printer's name
: manufacturer, etc. The usb -vvv, however, doesn't display

Are these strings in the string table, in the interface descriptor as a
vendor extension, or something that requires a data transfer command?

Unfortunately "usb" doesn't dump the entire string table (I should make
it do so). It will display embedded vendor descriptors with '-V'. You
can use usdb_parse_descriptors() (or the lower-level usbd_descriptor())
to obtain these all from code though.

Otherwise you can use usbd_setup_vendor() and usbd_io() with the
appropriate USB_TYPE_* / USB_RECIPIENT_* targetting to get this data
with an IO transfer.

Post Reply

Return to “qdn.public.ddk.usb”