8 #ifndef META_OCEAN_SYSTEM_USB_UTILITIES_H
9 #define META_OCEAN_SYSTEM_USB_UTILITIES_H
74 using ProductMap = std::unordered_map<uint16_t, Product>;
124 static std::string
productName(
const uint16_t vendorId,
const uint16_t productId);
152 static inline bool doesDeviceContainCategory(
const libusb_device_descriptor& deviceDescriptor,
const DeviceCategory deviceCategory);
164 deviceName_(std::move(deviceName)),
165 deviceCategory_(deviceCategory)
172 productMap_(std::move(productMap))
This class holds the relevant information of a USB product.
Definition: system/usb/Utilities.h:47
std::string deviceName_
The name of the product.
Definition: system/usb/Utilities.h:65
Product()=default
Default constructor.
This class holds several products of a vendor.
Definition: system/usb/Utilities.h:80
std::string vendorName_
The name of the vendor.
Definition: system/usb/Utilities.h:98
ProductMap productMap_
The map with all known products of the vendor.
Definition: system/usb/Utilities.h:101
Vendor()=default
Default constructor.
This class implements utility functions for USB devices.
Definition: system/usb/Utilities.h:27
DeviceCategory
Definition of individual device categories.
Definition: system/usb/Utilities.h:34
static DeviceCategory deviceCategory(const uint16_t vendorId, const uint16_t productId)
Lookups the device category of a device defined by it's vendor and product id.
static bool doesDeviceContainCategory(const uint16_t vendorId, const uint16_t productId, const uint8_t deviceClass, const DeviceCategory deviceCategory)
Checks whether a device contains a specific category.
static const VendorMap & vendorMap()
Returns the lookup table with all known vendors.
static std::string vendorName(const uint16_t vendorId)
Lookups the name of a vendor id (if known).
std::unordered_map< uint16_t, Product > ProductMap
Definition of an unordered map mapping product ids to products.
Definition: system/usb/Utilities.h:74
static std::string productName(const uint16_t vendorId, const uint16_t productId)
Lookups the name of a product id (if known).
std::unordered_map< uint16_t, Vendor > VendorMap
Definition of an unordered map mapping vendor ids to vendor objects (a lookup table for USB devices).
Definition: system/usb/Utilities.h:107
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15