This library uses usb.ids file to provide easy translate api from vendors and products codes provided by libs like libusb to real names.
USB Human Name is a minimal project that's kept deliberately very small. When you build it using CMake/make (see below) it generates:
- A tiny static library
libusb_human_name
, - An executable unit test
Google_Tests_run
using Google Test library.
You will need:
- A modern C/C++ compiler
- CMake 3.1+ installed (on a Mac, run
brew install cmake
) - If you prefer to code in a great IDE, I highly recommend Jetbrains CLion. It is fully compatible with this project.
First we need to check out the git repo:
❯ mkdir ~/workspace
❯ cd ~/workspace
❯ git clone \
https://github.com/garrylachman/usb-human-name \
usb-human-name
❯ cd usb-human-name
❯ mkdir build
❯ cd build
❯ cmake ..
❯ make
❯ Google_tests/Google_Tests_run
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from DBFileTestSuite
[ RUN ] DBFileTestSuite.ReadyTest
[ OK ] DBFileTestSuite.ReadyTest (2 ms)
[ RUN ] DBFileTestSuite.FindVendorTest
[ OK ] DBFileTestSuite.FindVendorTest (0 ms)
[ RUN ] DBFileTestSuite.FindProductTest
[ OK ] DBFileTestSuite.FindProductTest (0 ms)
[ RUN ] DBFileTestSuite.FullDataTest
[ OK ] DBFileTestSuite.FullDataTest (36181 ms)
[----------] 4 tests from DBFileTestSuite (36184 ms total)
[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (36184 ms total)
[ PASSED ] 4 tests.
usb-human-name_lib/*
— C++ code that ultimately compiles into a libraryGoogle_tests/lib
— C++ libraries used for tests (eg, Google Test)Google_tests
— C++ test suite
Pull Requests are WELCOME! Please submit any fixes or improvements, and I promise to review it as soon as I can at the project URL:
© 2020 Garry Lachman (garry@lachman.co).
Open sourced under MIT license, the terms of which can be read here — MIT License.