mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Refactor USB vendor/product to product string to UsbUtil.h.
Also implement reading of /var/lib/usbutils/usb.ids for systems that have it (e.g. desktop Linux).
This commit is contained in:
21
src/UsbUtil.h
Normal file
21
src/UsbUtil.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CS_USBUTIL_H_
|
||||
#define CS_USBUTIL_H_
|
||||
|
||||
#include "llvm/SmallVector.h"
|
||||
#include "llvm/StringRef.h"
|
||||
|
||||
namespace cs {
|
||||
|
||||
llvm::StringRef GetUsbNameFromId(int vendor, int product,
|
||||
llvm::SmallVectorImpl<char>& buf);
|
||||
|
||||
} // namespace cs
|
||||
|
||||
#endif // CS_USBUTIL_H_
|
||||
Reference in New Issue
Block a user