mirror of
https://github.com/jankae/LibreVNA.git
synced 2025-12-06 07:12:10 +01:00
23 lines
430 B
C++
23 lines
430 B
C++
|
|
#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;
|
||
|
|
}
|