Implement open() and close() for Usb class, added a lot of TODO's

This commit is contained in:
2022-11-13 21:28:28 +01:00
parent f09e4ab5c8
commit 38906dafef
11 changed files with 103 additions and 30 deletions

View File

@@ -1,8 +1,6 @@
#include "IUsb.hpp"
#include "UsbTypes.hpp"
#include <libusb-1.0/libusb.h>
#pragma once
namespace ptprnt::driver {
@@ -13,9 +11,12 @@ class Usb : public IUsb {
~Usb() override;
std::optional<std::vector<UsbDevice>> getDevices() override;
std::optional<UsbDevice> open(UsbDevice) override;
bool close(UsbDevice) override;
private:
// TODO: This should be a std::map with handles & locking on access
std::vector<UsbDevice> mDevices{};
};
} // namespace ptprnt::driver
} // namespace ptprnt::driver