Add USB stub, add logging using spdlog

This commit is contained in:
2022-11-12 15:28:21 +01:00
parent de62dd76bf
commit b20fa5ff13
8 changed files with 106 additions and 7 deletions
+16
View File
@@ -0,0 +1,16 @@
#include "UsbTypes.hpp"
#include <vector>
#pragma once
namespace ptprnt::driver {
class IUsb {
public:
virtual ~IUsb(){};
virtual std::vector<UsbDevice> listDevices() = 0;
};
} // namespace ptprnt::driver
+20
View File
@@ -0,0 +1,20 @@
#include "IUsb.hpp"
#include <libusb-1.0/libusb.h>
#pragma once
namespace ptprnt::driver {
class Usb : public IUsb {
public:
Usb();
~Usb() override;
std::vector<UsbDevice> listDevices() override;
private:
};
} // namespace ptprnt::driver
+13
View File
@@ -0,0 +1,13 @@
#include <libusb-1.0/libusb.h>
#pragma once
namespace ptprnt::driver {
struct UsbDevice {
libusb_device* dev{nullptr};
libusb_device_handle* hndl{nullptr};
};
} // namespace ptprnt::driver