Re-structured project
This commit is contained in:
34
src/libusbwrap/interface/IUsbDevice.hpp
Normal file
34
src/libusbwrap/interface/IUsbDevice.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "libusb.h"
|
||||
#include "libusbwrap/LibUsbTypes.hpp"
|
||||
|
||||
namespace libusbwrap {
|
||||
namespace device {
|
||||
enum class Speed {
|
||||
UNKNOWN = LIBUSB_SPEED_UNKNOWN,
|
||||
LOW = LIBUSB_SPEED_LOW,
|
||||
FULL = LIBUSB_SPEED_FULL,
|
||||
HIGH = LIBUSB_SPEED_HIGH,
|
||||
SUPER = LIBUSB_SPEED_SUPER,
|
||||
SUPER_PLUS = LIBUSB_SPEED_SUPER_PLUS
|
||||
};
|
||||
} // namespace device
|
||||
|
||||
class IUsbDevice {
|
||||
public:
|
||||
virtual Error open() = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
// getters
|
||||
const virtual uint16_t getVid() = 0;
|
||||
const virtual uint16_t getPid() = 0;
|
||||
const virtual device::Speed getSpeed() = 0;
|
||||
const virtual uint8_t getBusNumber() = 0;
|
||||
const virtual uint8_t getPortNumber() = 0;
|
||||
};
|
||||
} // namespace libusbwrap
|
Reference in New Issue
Block a user