pciid-parser

Crates.iopciid-parser
lib.rspciid-parser
version0.7.2
sourcesrc
created_at2021-12-10 07:47:36.883714
updated_at2024-02-05 19:21:18.840969
descriptionA library for parsing PCI ID tables
homepagehttps://github.com/ilyazzz/pci-id-parser
repositoryhttps://github.com/ilyazzz/pci-id-parser
max_upload_size
id495610
size1,422,721
Ilya Zlobintsev (ilya-zlobintsev)

documentation

README

PCI ID Parser

Crates.io Docs.rs

This is a library that lets you use a PCI ID database, such as one shipped with Linux distros or from https://pci-ids.ucw.cz/. It can either read the locally installed file or fetch one from the website.

Usage

Read the local DB:

use pciid_parser::Database;

let db = Database::read().unwrap();

// Get vendor
let vendor = db.vendors.get("1002").unwrap();
assert_eq!(vendor.name, "Advanced Micro Devices, Inc. [AMD/ATI]");
// Get device
let device = vendor.devices.get("67df").unwrap();
assert_eq!(
  device.name,
  "Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]"
);  

// Get full device and subdevice info:
let info = db.get_device_info("1002", "67DF", "1DA2", "E387");

// Get class
let class = db.classes.get("05").unwrap();
assert_eq!(class.name, "Memory controller");

You can also fetch the online DB:

use pciid_parser::Database;

let db = Database::get_online().unwrap();
Commit count: 37

cargo fmt