Difference between revisions of "Template:USBID"

From ThinkWiki
Jump to: navigation, search
(1st attempt to add a USB ID template, which links to the external USB IDs database.)
 
m (rephrased)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if|{{{1|}}}
+
<noinclude>
    |{{#if|{{{2|}}}
+
This Template links to the USB ID Repository. Its <samp>usb.ids</samp> file is used by <samp>lsusb</samp> to display the vendor and device names for the corresponding numeric IDs of the USB device.
    |[https://usb-ids.gowdy.us/read/UD/{{{1}}}/{{{2}}} USB ID {{{1}}}:{{{2}}}]
+
 
    |[https://usb-ids.gowdy.us/read/UD/{{{1}}} USB ID {{{1}}}]|
+
=== Usage ===
    }}
+
Both the four-digit vendor ID and the four-digit product (or device or item) ID must be specified.
    |USB ID|
+
<nowiki>{{USBID|</nowiki>''vendor ID''<nowiki>|</nowiki>''product ID''<nowiki>}}</nowiki>
}}
+
Parameters <code>1=</code> and <code>2=</code> are optional, but possible:
 +
<nowiki>{{USBID|1=</nowiki>''vendor ID''<nowiki>|2=</nowiki>''product ID''<nowiki>}}</nowiki>
 +
 
 +
=== Examples ===
 +
Use <samp>lsusb</samp> to find the USB device in question:
 +
$ lsusb
 +
Bus 001 Device 001: ID '''8086:0044''' Intel Corp. CPU DRAM Controller
 +
 
 +
For this USB device, vendor '''<samp>8086</samp>''' being ''Intel Corp.'' and product '''<samp>0044</samp>''' being the processors' DRAM Controller, the following wiki source text will link to the corresponding USB ID Repository webpage:
 +
<nowiki>{{USBID|</nowiki>'''8086'''<nowiki>|</nowiki>'''0044'''<nowiki>}}</nowiki>
 +
 
 +
The output on the displayed ThinkWiki page will be the same as the <samp>vendor:product</samp> output from <samp>lsusb</samp>:
 +
[https://usb-ids.gowdy.us/read/UD/8086/0044 8086:0044]
 +
 
 +
<!-- Don't know why this doesn't work:
 +
{{#if | {{{1|}}} | {{#if | {{{2|}}} | [https://usb-ids.gowdy.us/read/UD/{{{1}}}/{{{2}}} {{{1}}}:{{{2}}}] | [https://usb-ids.gowdy.us/read/UD/{{{1}}} {{{1}}}]| }} | USB ID | }}
 +
-->
 +
</noinclude>
 +
[https://usb-ids.gowdy.us/read/UD/{{{1}}}/{{{2}}} {{{1}}}:{{{2}}}]

Latest revision as of 17:48, 2 February 2022

This Template links to the USB ID Repository. Its usb.ids file is used by lsusb to display the vendor and device names for the corresponding numeric IDs of the USB device.

Usage

Both the four-digit vendor ID and the four-digit product (or device or item) ID must be specified.

{{USBID|vendor ID|product ID}}

Parameters 1= and 2= are optional, but possible:

{{USBID|1=vendor ID|2=product ID}}

Examples

Use lsusb to find the USB device in question:

$ lsusb
Bus 001 Device 001: ID 8086:0044 Intel Corp. CPU DRAM Controller

For this USB device, vendor 8086 being Intel Corp. and product 0044 being the processors' DRAM Controller, the following wiki source text will link to the corresponding USB ID Repository webpage:

{{USBID|8086|0044}}

The output on the displayed ThinkWiki page will be the same as the vendor:product output from lsusb:

8086:0044


{{{1}}}:{{{2}}}