Added Usb Detection using libUsb

This commit is contained in:
2022-11-12 18:29:04 +01:00
parent 2770a2a2cc
commit 298cbe393b
8 changed files with 171 additions and 106 deletions

View File

@@ -1,20 +1,29 @@
#include "IDriver.hpp"
#include <cstdint>
#include <memory>
#include "Usb.hpp"
#pragma once
namespace ptprnt::driver {
class P700Driver : public IDriver {
public:
P700Driver(uint16_t UsbDevVendor = 0x04f9, uint16_t UsbDevId = 0x2061);
public:
P700Driver(std::shared_ptr<Usb> usbDriver, uint16_t usbDevVendor = 0x04f9, uint16_t usbDevId = 0x2061);
~P700Driver() override;
driver::info getInfo() override;
bool open() override;
bool close() override;
bool command() override;
private:
std::shared_ptr<Usb> mUsbDriver{0};
UsbDevice mUsbDev{0};
bool init();
};
} // namespace ptprnt::driver