All checks were successful
Build ptprnt / build (push) Successful in 1m1s
Co-authored-by: Moritz Martinius <mm@cloudprinters.de> Reviewed-on: #11
23 lines
562 B
C++
23 lines
562 B
C++
#include "PrinterDriverFactory.hpp"
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "P700Printer.hpp"
|
|
#include "libusbwrap/LibUsbTypes.hpp"
|
|
|
|
namespace ptprnt {
|
|
|
|
std::shared_ptr<IPrinterDriver> PrinterDriverFactory::create(libusbwrap::usbId id) {
|
|
|
|
if (printer::P700Printer::mInfo.usbId == id) {
|
|
spdlog::info("Found printer P700!");
|
|
return std::make_shared<printer::P700Printer>();
|
|
} else {
|
|
spdlog::trace("{:04x}:{:04x} is not a compatible printer", id.first, id.second);
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
} // namespace ptprnt
|