|
Modules
ADT Database GTK2 GUI IP PiJAX Public Sql Stdio Subversion System Tools Xosd lua v4l2 wx
Recent Changes
Public.USB 1.0
Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Popular Downloads
Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48
|
Pike Module Reference: module version 1, prepared
| MODULE Public.USB |
Methods get_vendor_name() load_vendor_database()
|
-
Inherit ___USB
Public.___USB
-
Method load_vendor_database
int Public.USB.load_vendor_database()
- Description
Load the USB vendor ID database from usb.ids file.
Attempts to load from multiple locations:
- ./usb.ids (current directory)
- /usr/share/hwdata/usb.ids (Linux)
- /usr/share/misc/usb.ids (BSD)
- Returns
Number of vendors loaded, or 0 if file not found
-
Method get_vendor_name
string|int Public.USB.get_vendor_name(int vendor_id)
- Description
Get the vendor name for a given USB vendor ID.
- Parameter vendor_id
The USB vendor ID (VID) to look up
- Returns
The vendor name as a string, or 0 if not found
- Example
object usb = Public.USB.USB();
string vendor = usb->get_vendor_name(0x046d);
write("Vendor: %s\n", vendor || "Unknown");
|
|