WIP: device driver abstraction

This commit is contained in:
Jan Käberich 2023-01-16 00:25:29 +01:00
parent 59e30e93c5
commit db6d823e0f
42 changed files with 1631 additions and 576 deletions

View file

@ -0,0 +1,22 @@
#include "devicedriver.h"
DeviceDriver *DeviceDriver::activeDriver = nullptr;
bool DeviceDriver::connectDevice(QString serial)
{
if(activeDriver && activeDriver != this) {
activeDriver->disconnect();
}
if(connectTo(serial)) {
activeDriver = this;
return true;
} else {
return false;
}
}
void DeviceDriver::disconnectDevice()
{
disconnect();
activeDriver = nullptr;
}