LibreVNA/Software/PC_Application/LibreVNA-GUI/Device/devicedriver.cpp

23 lines
430 B
C++
Raw Normal View History

2023-01-16 07:25:29 +08:00
#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;
}