mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-05 06:25:16 +00:00
Added single sweep functionality
This commit is contained in:
parent
53dcff8745
commit
d84d3e80aa
8 changed files with 124 additions and 11 deletions
|
|
@ -256,12 +256,12 @@ bool Device::Configure(Protocol::SweepSettings settings, std::function<void(Tran
|
|||
return SendPacket(p, cb);
|
||||
}
|
||||
|
||||
bool Device::Configure(Protocol::SpectrumAnalyzerSettings settings)
|
||||
bool Device::Configure(Protocol::SpectrumAnalyzerSettings settings, std::function<void (Device::TransmissionResult)> cb)
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::SpectrumAnalyzerSettings;
|
||||
p.spectrumSettings = settings;
|
||||
return SendPacket(p);
|
||||
return SendPacket(p, cb);
|
||||
}
|
||||
|
||||
bool Device::SetManual(Protocol::ManualControlV1 manual)
|
||||
|
|
@ -272,9 +272,9 @@ bool Device::SetManual(Protocol::ManualControlV1 manual)
|
|||
return SendPacket(p);
|
||||
}
|
||||
|
||||
bool Device::SetIdle()
|
||||
bool Device::SetIdle(std::function<void(TransmissionResult)> cb)
|
||||
{
|
||||
return SendCommandWithoutPayload(Protocol::PacketType::SetIdle);
|
||||
return SendCommandWithoutPayload(Protocol::PacketType::SetIdle, cb);
|
||||
}
|
||||
|
||||
bool Device::SendFirmwareChunk(Protocol::FirmwarePacket &fw)
|
||||
|
|
@ -285,11 +285,11 @@ bool Device::SendFirmwareChunk(Protocol::FirmwarePacket &fw)
|
|||
return SendPacket(p);
|
||||
}
|
||||
|
||||
bool Device::SendCommandWithoutPayload(Protocol::PacketType type)
|
||||
bool Device::SendCommandWithoutPayload(Protocol::PacketType type, std::function<void(TransmissionResult)> cb)
|
||||
{
|
||||
Protocol::PacketInfo p;
|
||||
p.type = type;
|
||||
return SendPacket(p);
|
||||
return SendPacket(p, cb);
|
||||
}
|
||||
|
||||
std::set<QString> Device::GetDevices()
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@ public:
|
|||
~Device();
|
||||
bool SendPacket(const Protocol::PacketInfo& packet, std::function<void(TransmissionResult)> cb = nullptr, unsigned int timeout = 500);
|
||||
bool Configure(Protocol::SweepSettings settings, std::function<void(TransmissionResult)> cb = nullptr);
|
||||
bool Configure(Protocol::SpectrumAnalyzerSettings settings);
|
||||
bool Configure(Protocol::SpectrumAnalyzerSettings settings, std::function<void(TransmissionResult)> cb = nullptr);
|
||||
bool SetManual(Protocol::ManualControlV1 manual);
|
||||
bool SetIdle();
|
||||
bool SetIdle(std::function<void(TransmissionResult)> cb = nullptr);
|
||||
bool SendFirmwareChunk(Protocol::FirmwarePacket &fw);
|
||||
bool SendCommandWithoutPayload(Protocol::PacketType type);
|
||||
bool SendCommandWithoutPayload(Protocol::PacketType type, std::function<void(TransmissionResult)> cb = nullptr);
|
||||
QString serial() const;
|
||||
const Protocol::DeviceInfo& Info();
|
||||
static const Protocol::DeviceInfo& Info(Device *dev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue