pnpid

Crates.iopnpid
lib.rspnpid
version1.0.2
sourcesrc
created_at2024-11-05 06:22:16.430242
updated_at2024-11-05 21:53:55.139715
descriptiona tiny library to map PNP IDs with company/vendor names
homepage
repositoryhttps://github.com/onkoe/pnpid
max_upload_size
id1436074
size128,294
Barrett Ray (onkoe)

documentation

README

pnpid

Provides a single function to get the PNP ID of a company on the registry.

These are used in liboptic during EDID parsing.

Usage

It's fairly easy to use. Pass in an UPPERCASE PNP ID, such as OVR or AMI, into the function:

use pnpid::company_from_pnp_id;

let id = "ADR";
let name = company_from_pnp_id(id).unwrap();

assert_eq!(name, "Nasa Ames Research Center");

Features

  • array: Provides a const array of all values in the list. This may bloat binary size, so be sure to remove it on embedded targets where necessary with cargo add pnpid --no-default-features.

Platform Support

This is a very simple library - anything that can run the internals of PartialEq is more than enough. It is also #![no_std], so feel free to use it in fun places. :)

Updating the List

The list of PNP IDs, located at /list.csv, needs to be updated manually. You may find the updated list on the UEFI Forum website.

License

This crate is licensed under the MPL v2.0. You can read that in the license file.

References

Thank you to @golightlyb for making PNP-ID, a C library that showed me that there's a CSV file (and that I don't need to parse PDF..!)

Commit count: 15

cargo fmt