mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-30 16:18:50 -04:00
Server and web API: added HackRF support
This commit is contained in:
parent
d650010375
commit
1b96f25184
@ -279,7 +279,7 @@ bool HackRFOutput::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
void HackRFOutput::setCenterFrequency(quint64 freq_hz, qint32 LOppmTenths)
|
||||
void HackRFOutput::setDeviceCenterFrequency(quint64 freq_hz, qint32 LOppmTenths)
|
||||
{
|
||||
qint64 df = ((qint64)freq_hz * LOppmTenths) / 10000000LL;
|
||||
freq_hz += df;
|
||||
@ -288,11 +288,11 @@ void HackRFOutput::setCenterFrequency(quint64 freq_hz, qint32 LOppmTenths)
|
||||
|
||||
if (rc != HACKRF_SUCCESS)
|
||||
{
|
||||
qWarning("HackRFOutput::setCenterFrequency: could not frequency to %llu Hz", freq_hz);
|
||||
qWarning("HackRFOutput::setDeviceCenterFrequency: could not frequency to %llu Hz", freq_hz);
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("HackRFOutput::setCenterFrequency: frequency set to %llu Hz", freq_hz);
|
||||
qWarning("HackRFOutput::setDeviceCenterFrequency: frequency set to %llu Hz", freq_hz);
|
||||
}
|
||||
}
|
||||
|
||||
@ -368,7 +368,7 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
|
||||
{
|
||||
if (m_dev != 0)
|
||||
{
|
||||
setCenterFrequency(settings.m_centerFrequency, settings.m_LOppmTenths);
|
||||
setDeviceCenterFrequency(settings.m_centerFrequency, settings.m_LOppmTenths);
|
||||
qDebug() << "HackRFOutput::applySettings: center freq: " << settings.m_centerFrequency << " Hz LOppm: " << settings.m_LOppmTenths;
|
||||
}
|
||||
|
||||
@ -468,6 +468,73 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
|
||||
return true;
|
||||
}
|
||||
|
||||
int HackRFOutput::webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
response.setHackRfOutputSettings(new SWGSDRangel::SWGHackRFOutputSettings());
|
||||
webapiFormatDeviceSettings(response, m_settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
int HackRFOutput::webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
HackRFOutputSettings settings = m_settings;
|
||||
|
||||
if (deviceSettingsKeys.contains("centerFrequency")) {
|
||||
settings.m_centerFrequency = response.getHackRfOutputSettings()->getCenterFrequency();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("LOppmTenths")) {
|
||||
settings.m_LOppmTenths = response.getHackRfOutputSettings()->getLOppmTenths();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("bandwidth")) {
|
||||
settings.m_bandwidth = response.getHackRfOutputSettings()->getBandwidth();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("vgaGain")) {
|
||||
settings.m_vgaGain = response.getHackRfOutputSettings()->getVgaGain();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("log2Interp")) {
|
||||
settings.m_log2Interp = response.getHackRfOutputSettings()->getLog2Interp();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("devSampleRate")) {
|
||||
settings.m_devSampleRate = response.getHackRfOutputSettings()->getDevSampleRate();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("biasT")) {
|
||||
settings.m_biasT = response.getHackRfOutputSettings()->getBiasT() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("lnaExt")) {
|
||||
settings.m_lnaExt = response.getHackRfOutputSettings()->getLnaExt() != 0;
|
||||
}
|
||||
|
||||
MsgConfigureHackRF *msg = MsgConfigureHackRF::create(settings, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureHackRF *msgToGUI = MsgConfigureHackRF::create(settings, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
webapiFormatDeviceSettings(response, settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void HackRFOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const HackRFOutputSettings& settings)
|
||||
{
|
||||
response.getHackRfOutputSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
response.getHackRfOutputSettings()->setLOppmTenths(settings.m_LOppmTenths);
|
||||
response.getHackRfOutputSettings()->setBandwidth(settings.m_bandwidth);
|
||||
response.getHackRfOutputSettings()->setVgaGain(settings.m_vgaGain);
|
||||
response.getHackRfOutputSettings()->setLog2Interp(settings.m_log2Interp);
|
||||
response.getHackRfOutputSettings()->setDevSampleRate(settings.m_devSampleRate);
|
||||
response.getHackRfOutputSettings()->setBiasT(settings.m_biasT ? 1 : 0);
|
||||
response.getHackRfOutputSettings()->setLnaExt(settings.m_lnaExt ? 1 : 0);
|
||||
}
|
||||
|
||||
int HackRFOutput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
|
@ -109,6 +109,16 @@ public:
|
||||
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
@ -123,7 +133,8 @@ private:
|
||||
void closeDevice();
|
||||
bool applySettings(const HackRFOutputSettings& settings, bool force);
|
||||
// hackrf_device *open_hackrf_from_sequence(int sequence);
|
||||
void setCenterFrequency(quint64 freq_hz, qint32 LOppmTenths);
|
||||
void setDeviceCenterFrequency(quint64 freq_hz, qint32 LOppmTenths);
|
||||
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const HackRFOutputSettings& settings);
|
||||
|
||||
DeviceSinkAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
|
@ -300,7 +300,7 @@ bool HackRFInput::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
void HackRFInput::setCenterFrequency(quint64 freq_hz)
|
||||
void HackRFInput::setDeviceCenterFrequency(quint64 freq_hz)
|
||||
{
|
||||
qint64 df = ((qint64)freq_hz * m_settings.m_LOppmTenths) / 10000000LL;
|
||||
freq_hz += df;
|
||||
@ -309,11 +309,11 @@ void HackRFInput::setCenterFrequency(quint64 freq_hz)
|
||||
|
||||
if (rc != HACKRF_SUCCESS)
|
||||
{
|
||||
qWarning("HackRFInput::setCenterFrequency: could not frequency to %llu Hz", freq_hz);
|
||||
qWarning("HackRFInput::setDeviceCenterFrequency: could not frequency to %llu Hz", freq_hz);
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("HackRFInput::setCenterFrequency: frequency set to %llu Hz", freq_hz);
|
||||
qWarning("HackRFInput::setDeviceCenterFrequency: frequency set to %llu Hz", freq_hz);
|
||||
}
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
|
||||
|
||||
if (m_dev != 0)
|
||||
{
|
||||
setCenterFrequency(deviceCenterFrequency);
|
||||
setDeviceCenterFrequency(deviceCenterFrequency);
|
||||
|
||||
qDebug() << "HackRFInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
|
||||
<< " device center freq: " << deviceCenterFrequency << " Hz"
|
||||
@ -557,6 +557,90 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
|
||||
return true;
|
||||
}
|
||||
|
||||
int HackRFInput::webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
response.setHackRfInputSettings(new SWGSDRangel::SWGHackRFInputSettings());
|
||||
webapiFormatDeviceSettings(response, m_settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
int HackRFInput::webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
HackRFInputSettings settings = m_settings;
|
||||
|
||||
if (deviceSettingsKeys.contains("centerFrequency")) {
|
||||
settings.m_centerFrequency = response.getHackRfInputSettings()->getCenterFrequency();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("LOppmTenths")) {
|
||||
settings.m_LOppmTenths = response.getHackRfInputSettings()->getLOppmTenths();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("bandwidth")) {
|
||||
settings.m_bandwidth = response.getHackRfInputSettings()->getBandwidth();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("lnaGain")) {
|
||||
settings.m_lnaGain = response.getHackRfInputSettings()->getLnaGain();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("vgaGain")) {
|
||||
settings.m_vgaGain = response.getHackRfInputSettings()->getVgaGain();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("log2Interp")) {
|
||||
settings.m_log2Decim = response.getHackRfInputSettings()->getLog2Decim();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("devSampleRate")) {
|
||||
settings.m_devSampleRate = response.getHackRfInputSettings()->getDevSampleRate();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("biasT")) {
|
||||
settings.m_biasT = response.getHackRfInputSettings()->getBiasT() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("lnaExt")) {
|
||||
settings.m_lnaExt = response.getHackRfInputSettings()->getLnaExt() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("dcBlock")) {
|
||||
settings.m_dcBlock = response.getHackRfInputSettings()->getDcBlock() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("iqCorrection")) {
|
||||
settings.m_iqCorrection = response.getHackRfInputSettings()->getIqCorrection() != 0;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("linkTxFrequency")) {
|
||||
settings.m_linkTxFrequency = response.getHackRfInputSettings()->getLinkTxFrequency() != 0;
|
||||
}
|
||||
|
||||
MsgConfigureHackRF *msg = MsgConfigureHackRF::create(settings, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureHackRF *msgToGUI = MsgConfigureHackRF::create(settings, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
webapiFormatDeviceSettings(response, settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void HackRFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const HackRFInputSettings& settings)
|
||||
{
|
||||
response.getHackRfInputSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
response.getHackRfInputSettings()->setLOppmTenths(settings.m_LOppmTenths);
|
||||
response.getHackRfInputSettings()->setBandwidth(settings.m_bandwidth);
|
||||
response.getHackRfInputSettings()->setLnaGain(settings.m_lnaGain);
|
||||
response.getHackRfInputSettings()->setVgaGain(settings.m_vgaGain);
|
||||
response.getHackRfInputSettings()->setLog2Decim(settings.m_log2Decim);
|
||||
response.getHackRfInputSettings()->setFcPos(settings.m_fcPos);
|
||||
response.getHackRfInputSettings()->setDevSampleRate(settings.m_devSampleRate);
|
||||
response.getHackRfInputSettings()->setBiasT(settings.m_biasT ? 1 : 0);
|
||||
response.getHackRfInputSettings()->setLnaExt(settings.m_lnaExt ? 1 : 0);
|
||||
response.getHackRfInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
|
||||
response.getHackRfInputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
|
||||
response.getHackRfInputSettings()->setLinkTxFrequency(settings.m_linkTxFrequency ? 1 : 0);
|
||||
}
|
||||
|
||||
int HackRFInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
|
@ -130,6 +130,16 @@ public:
|
||||
|
||||
virtual bool handleMessage(const Message& message);
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& deviceSettingsKeys,
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
@ -145,7 +155,8 @@ private:
|
||||
void closeDevice();
|
||||
bool applySettings(const HackRFInputSettings& settings, bool force);
|
||||
// hackrf_device *open_hackrf_from_sequence(int sequence);
|
||||
void setCenterFrequency(quint64 freq);
|
||||
void setDeviceCenterFrequency(quint64 freq);
|
||||
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const HackRFInputSettings& settings);
|
||||
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
QMutex m_mutex;
|
||||
|
@ -979,14 +979,20 @@ margin-bottom: 20px;
|
||||
"fileSourceSettings" : {
|
||||
"$ref" : "#/definitions/FileSourceSettings"
|
||||
},
|
||||
"rtlSdrSettings" : {
|
||||
"$ref" : "#/definitions/RtlSdrSettings"
|
||||
"hackRFInputSettings" : {
|
||||
"$ref" : "#/definitions/HackRFInputSettings"
|
||||
},
|
||||
"hackRFOutputSettings" : {
|
||||
"$ref" : "#/definitions/HackRFOutputSettings"
|
||||
},
|
||||
"limeSdrInputSettings" : {
|
||||
"$ref" : "#/definitions/LimeSdrInputSettings"
|
||||
},
|
||||
"limeSdrOutputSettings" : {
|
||||
"$ref" : "#/definitions/LimeSdrOutputSettings"
|
||||
},
|
||||
"rtlSdrSettings" : {
|
||||
"$ref" : "#/definitions/RtlSdrSettings"
|
||||
}
|
||||
},
|
||||
"description" : "Base device settings"
|
||||
@ -1017,6 +1023,82 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "FileSource"
|
||||
};
|
||||
defs.HackRFInputSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
},
|
||||
"LOppmTenths" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandwidth" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"vgaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Decim" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"fcPos" : {
|
||||
"type" : "integer",
|
||||
"description" : "0=Infra 1=Supra 2=Center"
|
||||
},
|
||||
"devSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"biasT" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaExt" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"dcBlock" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"iqCorrection" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"linkTxFrequency" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "HackRF"
|
||||
};
|
||||
defs.HackRFOutputSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
},
|
||||
"LOppmTenths" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandwidth" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"vgaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Interp" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"devSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"biasT" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaExt" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "HackRF"
|
||||
};
|
||||
defs.InstanceChannelsResponse = {
|
||||
"required" : [ "channelcount" ],
|
||||
@ -16309,7 +16391,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2017-12-28T22:34:28.719+01:00
|
||||
Generated 2017-12-29T01:07:32.200+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1387,14 +1387,29 @@ bool WebAPIRequestMapper::validateDeviceSettings(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*deviceHwType == "RTLSDR")
|
||||
else if ((*deviceHwType == "HackRF") && (deviceSettings.getTx() == 0))
|
||||
{
|
||||
if (jsonObject.contains("rtlSdrSettings") && jsonObject["rtlSdrSettings"].isObject())
|
||||
if (jsonObject.contains("HackRFInputSettings") && jsonObject["HackRFInputSettings"].isObject())
|
||||
{
|
||||
QJsonObject rtlSdrSettingsJsonObject = jsonObject["rtlSdrSettings"].toObject();
|
||||
deviceSettingsKeys = rtlSdrSettingsJsonObject.keys();
|
||||
deviceSettings.setRtlSdrSettings(new SWGSDRangel::SWGRtlSdrSettings());
|
||||
deviceSettings.getRtlSdrSettings()->fromJsonObject(rtlSdrSettingsJsonObject);
|
||||
QJsonObject hackRFInputSettingsJsonObject = jsonObject["HackRFInputSettings"].toObject();
|
||||
deviceSettingsKeys = hackRFInputSettingsJsonObject.keys();
|
||||
deviceSettings.setHackRfInputSettings(new SWGSDRangel::SWGHackRFInputSettings());
|
||||
deviceSettings.getHackRfInputSettings()->fromJsonObject(hackRFInputSettingsJsonObject);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ((*deviceHwType == "HackRF") && (deviceSettings.getTx() != 0))
|
||||
{
|
||||
if (jsonObject.contains("HackRFOutputSettings") && jsonObject["HackRFOutputSettings"].isObject())
|
||||
{
|
||||
QJsonObject hackRFOutputSettingsJsonObject = jsonObject["HackRFOutputSettings"].toObject();
|
||||
deviceSettingsKeys = hackRFOutputSettingsJsonObject.keys();
|
||||
deviceSettings.setHackRfOutputSettings(new SWGSDRangel::SWGHackRFOutputSettings());
|
||||
deviceSettings.getHackRfOutputSettings()->fromJsonObject(hackRFOutputSettingsJsonObject);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -1432,6 +1447,21 @@ bool WebAPIRequestMapper::validateDeviceSettings(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (*deviceHwType == "RTLSDR")
|
||||
{
|
||||
if (jsonObject.contains("rtlSdrSettings") && jsonObject["rtlSdrSettings"].isObject())
|
||||
{
|
||||
QJsonObject rtlSdrSettingsJsonObject = jsonObject["rtlSdrSettings"].toObject();
|
||||
deviceSettingsKeys = rtlSdrSettingsJsonObject.keys();
|
||||
deviceSettings.setRtlSdrSettings(new SWGSDRangel::SWGRtlSdrSettings());
|
||||
deviceSettings.getRtlSdrSettings()->fromJsonObject(rtlSdrSettingsJsonObject);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
52
swagger/sdrangel/api/swagger/include/HackRF.yaml
Normal file
52
swagger/sdrangel/api/swagger/include/HackRF.yaml
Normal file
@ -0,0 +1,52 @@
|
||||
HackRFInputSettings:
|
||||
description: HackRF
|
||||
properties:
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: int64
|
||||
LOppmTenths:
|
||||
type: integer
|
||||
bandwidth:
|
||||
type: integer
|
||||
lnaGain:
|
||||
type: integer
|
||||
vgaGain:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
fcPos:
|
||||
description: 0=Infra 1=Supra 2=Center
|
||||
type: integer
|
||||
devSampleRate:
|
||||
type: integer
|
||||
biasT:
|
||||
type: integer
|
||||
lnaExt:
|
||||
type: integer
|
||||
dcBlock:
|
||||
type: integer
|
||||
iqCorrection:
|
||||
type: integer
|
||||
linkTxFrequency:
|
||||
type: integer
|
||||
|
||||
HackRFOutputSettings:
|
||||
description: HackRF
|
||||
properties:
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: int64
|
||||
LOppmTenths:
|
||||
type: integer
|
||||
bandwidth:
|
||||
type: integer
|
||||
vgaGain:
|
||||
type: integer
|
||||
log2Interp:
|
||||
type: integer
|
||||
devSampleRate:
|
||||
type: integer
|
||||
biasT:
|
||||
type: integer
|
||||
lnaExt:
|
||||
type: integer
|
@ -1425,12 +1425,16 @@ definitions:
|
||||
type: integer
|
||||
fileSourceSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/FileSource.yaml#/FileSourceSettings"
|
||||
rtlSdrSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/RtlSdr.yaml#/RtlSdrSettings"
|
||||
hackRFInputSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/HackRF.yaml#/HackRFInputSettings"
|
||||
hackRFOutputSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/HackRF.yaml#/HackRFOutputSettings"
|
||||
limeSdrInputSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/LimeSdr.yaml#/LimeSdrInputSettings"
|
||||
limeSdrOutputSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/LimeSdr.yaml#/LimeSdrOutputSettings"
|
||||
rtlSdrSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/RtlSdr.yaml#/RtlSdrSettings"
|
||||
|
||||
ChannelSettings:
|
||||
description: Base channel settings
|
||||
|
@ -979,14 +979,20 @@ margin-bottom: 20px;
|
||||
"fileSourceSettings" : {
|
||||
"$ref" : "#/definitions/FileSourceSettings"
|
||||
},
|
||||
"rtlSdrSettings" : {
|
||||
"$ref" : "#/definitions/RtlSdrSettings"
|
||||
"hackRFInputSettings" : {
|
||||
"$ref" : "#/definitions/HackRFInputSettings"
|
||||
},
|
||||
"hackRFOutputSettings" : {
|
||||
"$ref" : "#/definitions/HackRFOutputSettings"
|
||||
},
|
||||
"limeSdrInputSettings" : {
|
||||
"$ref" : "#/definitions/LimeSdrInputSettings"
|
||||
},
|
||||
"limeSdrOutputSettings" : {
|
||||
"$ref" : "#/definitions/LimeSdrOutputSettings"
|
||||
},
|
||||
"rtlSdrSettings" : {
|
||||
"$ref" : "#/definitions/RtlSdrSettings"
|
||||
}
|
||||
},
|
||||
"description" : "Base device settings"
|
||||
@ -1017,6 +1023,82 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "FileSource"
|
||||
};
|
||||
defs.HackRFInputSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
},
|
||||
"LOppmTenths" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandwidth" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"vgaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Decim" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"fcPos" : {
|
||||
"type" : "integer",
|
||||
"description" : "0=Infra 1=Supra 2=Center"
|
||||
},
|
||||
"devSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"biasT" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaExt" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"dcBlock" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"iqCorrection" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"linkTxFrequency" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "HackRF"
|
||||
};
|
||||
defs.HackRFOutputSettings = {
|
||||
"properties" : {
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
},
|
||||
"LOppmTenths" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandwidth" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"vgaGain" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"log2Interp" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"devSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"biasT" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"lnaExt" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "HackRF"
|
||||
};
|
||||
defs.InstanceChannelsResponse = {
|
||||
"required" : [ "channelcount" ],
|
||||
@ -16309,7 +16391,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2017-12-28T22:34:28.719+01:00
|
||||
Generated 2017-12-29T01:07:32.200+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -40,9 +40,11 @@ SWGDeviceSettings::init() {
|
||||
device_hw_type = new QString("");
|
||||
tx = 0;
|
||||
file_source_settings = new SWGFileSourceSettings();
|
||||
rtl_sdr_settings = new SWGRtlSdrSettings();
|
||||
hack_rf_input_settings = new SWGHackRFInputSettings();
|
||||
hack_rf_output_settings = new SWGHackRFOutputSettings();
|
||||
lime_sdr_input_settings = new SWGLimeSdrInputSettings();
|
||||
lime_sdr_output_settings = new SWGLimeSdrOutputSettings();
|
||||
rtl_sdr_settings = new SWGRtlSdrSettings();
|
||||
}
|
||||
|
||||
void
|
||||
@ -57,8 +59,12 @@ SWGDeviceSettings::cleanup() {
|
||||
delete file_source_settings;
|
||||
}
|
||||
|
||||
if(rtl_sdr_settings != nullptr) {
|
||||
delete rtl_sdr_settings;
|
||||
if(hack_rf_input_settings != nullptr) {
|
||||
delete hack_rf_input_settings;
|
||||
}
|
||||
|
||||
if(hack_rf_output_settings != nullptr) {
|
||||
delete hack_rf_output_settings;
|
||||
}
|
||||
|
||||
if(lime_sdr_input_settings != nullptr) {
|
||||
@ -68,6 +74,10 @@ SWGDeviceSettings::cleanup() {
|
||||
if(lime_sdr_output_settings != nullptr) {
|
||||
delete lime_sdr_output_settings;
|
||||
}
|
||||
|
||||
if(rtl_sdr_settings != nullptr) {
|
||||
delete rtl_sdr_settings;
|
||||
}
|
||||
}
|
||||
|
||||
SWGDeviceSettings*
|
||||
@ -84,9 +94,11 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString");
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&file_source_settings, pJson["fileSourceSettings"], "SWGFileSourceSettings", "SWGFileSourceSettings");
|
||||
::SWGSDRangel::setValue(&rtl_sdr_settings, pJson["rtlSdrSettings"], "SWGRtlSdrSettings", "SWGRtlSdrSettings");
|
||||
::SWGSDRangel::setValue(&hack_rf_input_settings, pJson["hackRFInputSettings"], "SWGHackRFInputSettings", "SWGHackRFInputSettings");
|
||||
::SWGSDRangel::setValue(&hack_rf_output_settings, pJson["hackRFOutputSettings"], "SWGHackRFOutputSettings", "SWGHackRFOutputSettings");
|
||||
::SWGSDRangel::setValue(&lime_sdr_input_settings, pJson["limeSdrInputSettings"], "SWGLimeSdrInputSettings", "SWGLimeSdrInputSettings");
|
||||
::SWGSDRangel::setValue(&lime_sdr_output_settings, pJson["limeSdrOutputSettings"], "SWGLimeSdrOutputSettings", "SWGLimeSdrOutputSettings");
|
||||
::SWGSDRangel::setValue(&rtl_sdr_settings, pJson["rtlSdrSettings"], "SWGRtlSdrSettings", "SWGRtlSdrSettings");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -109,12 +121,16 @@ SWGDeviceSettings::asJsonObject() {
|
||||
|
||||
toJsonValue(QString("fileSourceSettings"), file_source_settings, obj, QString("SWGFileSourceSettings"));
|
||||
|
||||
toJsonValue(QString("rtlSdrSettings"), rtl_sdr_settings, obj, QString("SWGRtlSdrSettings"));
|
||||
toJsonValue(QString("hackRFInputSettings"), hack_rf_input_settings, obj, QString("SWGHackRFInputSettings"));
|
||||
|
||||
toJsonValue(QString("hackRFOutputSettings"), hack_rf_output_settings, obj, QString("SWGHackRFOutputSettings"));
|
||||
|
||||
toJsonValue(QString("limeSdrInputSettings"), lime_sdr_input_settings, obj, QString("SWGLimeSdrInputSettings"));
|
||||
|
||||
toJsonValue(QString("limeSdrOutputSettings"), lime_sdr_output_settings, obj, QString("SWGLimeSdrOutputSettings"));
|
||||
|
||||
toJsonValue(QString("rtlSdrSettings"), rtl_sdr_settings, obj, QString("SWGRtlSdrSettings"));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
@ -145,13 +161,22 @@ SWGDeviceSettings::setFileSourceSettings(SWGFileSourceSettings* file_source_sett
|
||||
this->file_source_settings = file_source_settings;
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings*
|
||||
SWGDeviceSettings::getRtlSdrSettings() {
|
||||
return rtl_sdr_settings;
|
||||
SWGHackRFInputSettings*
|
||||
SWGDeviceSettings::getHackRfInputSettings() {
|
||||
return hack_rf_input_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings) {
|
||||
this->rtl_sdr_settings = rtl_sdr_settings;
|
||||
SWGDeviceSettings::setHackRfInputSettings(SWGHackRFInputSettings* hack_rf_input_settings) {
|
||||
this->hack_rf_input_settings = hack_rf_input_settings;
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings*
|
||||
SWGDeviceSettings::getHackRfOutputSettings() {
|
||||
return hack_rf_output_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setHackRfOutputSettings(SWGHackRFOutputSettings* hack_rf_output_settings) {
|
||||
this->hack_rf_output_settings = hack_rf_output_settings;
|
||||
}
|
||||
|
||||
SWGLimeSdrInputSettings*
|
||||
@ -172,6 +197,15 @@ SWGDeviceSettings::setLimeSdrOutputSettings(SWGLimeSdrOutputSettings* lime_sdr_o
|
||||
this->lime_sdr_output_settings = lime_sdr_output_settings;
|
||||
}
|
||||
|
||||
SWGRtlSdrSettings*
|
||||
SWGDeviceSettings::getRtlSdrSettings() {
|
||||
return rtl_sdr_settings;
|
||||
}
|
||||
void
|
||||
SWGDeviceSettings::setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings) {
|
||||
this->rtl_sdr_settings = rtl_sdr_settings;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGHackRFInputSettings.h"
|
||||
#include "SWGHackRFOutputSettings.h"
|
||||
#include "SWGLimeSdrInputSettings.h"
|
||||
#include "SWGLimeSdrOutputSettings.h"
|
||||
#include "SWGRtlSdrSettings.h"
|
||||
@ -55,8 +57,11 @@ public:
|
||||
SWGFileSourceSettings* getFileSourceSettings();
|
||||
void setFileSourceSettings(SWGFileSourceSettings* file_source_settings);
|
||||
|
||||
SWGRtlSdrSettings* getRtlSdrSettings();
|
||||
void setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings);
|
||||
SWGHackRFInputSettings* getHackRfInputSettings();
|
||||
void setHackRfInputSettings(SWGHackRFInputSettings* hack_rf_input_settings);
|
||||
|
||||
SWGHackRFOutputSettings* getHackRfOutputSettings();
|
||||
void setHackRfOutputSettings(SWGHackRFOutputSettings* hack_rf_output_settings);
|
||||
|
||||
SWGLimeSdrInputSettings* getLimeSdrInputSettings();
|
||||
void setLimeSdrInputSettings(SWGLimeSdrInputSettings* lime_sdr_input_settings);
|
||||
@ -64,14 +69,19 @@ public:
|
||||
SWGLimeSdrOutputSettings* getLimeSdrOutputSettings();
|
||||
void setLimeSdrOutputSettings(SWGLimeSdrOutputSettings* lime_sdr_output_settings);
|
||||
|
||||
SWGRtlSdrSettings* getRtlSdrSettings();
|
||||
void setRtlSdrSettings(SWGRtlSdrSettings* rtl_sdr_settings);
|
||||
|
||||
|
||||
private:
|
||||
QString* device_hw_type;
|
||||
qint32 tx;
|
||||
SWGFileSourceSettings* file_source_settings;
|
||||
SWGRtlSdrSettings* rtl_sdr_settings;
|
||||
SWGHackRFInputSettings* hack_rf_input_settings;
|
||||
SWGHackRFOutputSettings* hack_rf_output_settings;
|
||||
SWGLimeSdrInputSettings* lime_sdr_input_settings;
|
||||
SWGLimeSdrOutputSettings* lime_sdr_output_settings;
|
||||
SWGRtlSdrSettings* rtl_sdr_settings;
|
||||
};
|
||||
|
||||
}
|
||||
|
260
swagger/sdrangel/code/qt5/client/SWGHackRFInputSettings.cpp
Normal file
260
swagger/sdrangel/code/qt5/client/SWGHackRFInputSettings.cpp
Normal file
@ -0,0 +1,260 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "SWGHackRFInputSettings.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGHackRFInputSettings::SWGHackRFInputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings::SWGHackRFInputSettings() {
|
||||
init();
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings::~SWGHackRFInputSettings() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFInputSettings::init() {
|
||||
center_frequency = 0L;
|
||||
l_oppm_tenths = 0;
|
||||
bandwidth = 0;
|
||||
lna_gain = 0;
|
||||
vga_gain = 0;
|
||||
log2_decim = 0;
|
||||
fc_pos = 0;
|
||||
dev_sample_rate = 0;
|
||||
bias_t = 0;
|
||||
lna_ext = 0;
|
||||
dc_block = 0;
|
||||
iq_correction = 0;
|
||||
link_tx_frequency = 0;
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFInputSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGHackRFInputSettings*
|
||||
SWGHackRFInputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFInputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&lna_gain, pJson["lnaGain"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&vga_gain, pJson["vgaGain"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&bias_t, pJson["biasT"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&lna_ext, pJson["lnaExt"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&link_tx_frequency, pJson["linkTxFrequency"], "qint32", "");
|
||||
}
|
||||
|
||||
QString
|
||||
SWGHackRFInputSettings::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGHackRFInputSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
|
||||
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
|
||||
obj->insert("bandwidth", QJsonValue(bandwidth));
|
||||
|
||||
obj->insert("lnaGain", QJsonValue(lna_gain));
|
||||
|
||||
obj->insert("vgaGain", QJsonValue(vga_gain));
|
||||
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
|
||||
obj->insert("biasT", QJsonValue(bias_t));
|
||||
|
||||
obj->insert("lnaExt", QJsonValue(lna_ext));
|
||||
|
||||
obj->insert("dcBlock", QJsonValue(dc_block));
|
||||
|
||||
obj->insert("iqCorrection", QJsonValue(iq_correction));
|
||||
|
||||
obj->insert("linkTxFrequency", QJsonValue(link_tx_frequency));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint64
|
||||
SWGHackRFInputSettings::getCenterFrequency() {
|
||||
return center_frequency;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setCenterFrequency(qint64 center_frequency) {
|
||||
this->center_frequency = center_frequency;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getLOppmTenths() {
|
||||
return l_oppm_tenths;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setLOppmTenths(qint32 l_oppm_tenths) {
|
||||
this->l_oppm_tenths = l_oppm_tenths;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getBandwidth() {
|
||||
return bandwidth;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setBandwidth(qint32 bandwidth) {
|
||||
this->bandwidth = bandwidth;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getLnaGain() {
|
||||
return lna_gain;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setLnaGain(qint32 lna_gain) {
|
||||
this->lna_gain = lna_gain;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getVgaGain() {
|
||||
return vga_gain;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setVgaGain(qint32 vga_gain) {
|
||||
this->vga_gain = vga_gain;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getLog2Decim() {
|
||||
return log2_decim;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setLog2Decim(qint32 log2_decim) {
|
||||
this->log2_decim = log2_decim;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getFcPos() {
|
||||
return fc_pos;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setFcPos(qint32 fc_pos) {
|
||||
this->fc_pos = fc_pos;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getDevSampleRate() {
|
||||
return dev_sample_rate;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setDevSampleRate(qint32 dev_sample_rate) {
|
||||
this->dev_sample_rate = dev_sample_rate;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getBiasT() {
|
||||
return bias_t;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setBiasT(qint32 bias_t) {
|
||||
this->bias_t = bias_t;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getLnaExt() {
|
||||
return lna_ext;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setLnaExt(qint32 lna_ext) {
|
||||
this->lna_ext = lna_ext;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getDcBlock() {
|
||||
return dc_block;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setDcBlock(qint32 dc_block) {
|
||||
this->dc_block = dc_block;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getIqCorrection() {
|
||||
return iq_correction;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setIqCorrection(qint32 iq_correction) {
|
||||
this->iq_correction = iq_correction;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFInputSettings::getLinkTxFrequency() {
|
||||
return link_tx_frequency;
|
||||
}
|
||||
void
|
||||
SWGHackRFInputSettings::setLinkTxFrequency(qint32 link_tx_frequency) {
|
||||
this->link_tx_frequency = link_tx_frequency;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
102
swagger/sdrangel/code/qt5/client/SWGHackRFInputSettings.h
Normal file
102
swagger/sdrangel/code/qt5/client/SWGHackRFInputSettings.h
Normal file
@ -0,0 +1,102 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGHackRFInputSettings.h
|
||||
*
|
||||
* HackRF
|
||||
*/
|
||||
|
||||
#ifndef SWGHackRFInputSettings_H_
|
||||
#define SWGHackRFInputSettings_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWGHackRFInputSettings: public SWGObject {
|
||||
public:
|
||||
SWGHackRFInputSettings();
|
||||
SWGHackRFInputSettings(QString* json);
|
||||
virtual ~SWGHackRFInputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGHackRFInputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
||||
qint32 getLOppmTenths();
|
||||
void setLOppmTenths(qint32 l_oppm_tenths);
|
||||
|
||||
qint32 getBandwidth();
|
||||
void setBandwidth(qint32 bandwidth);
|
||||
|
||||
qint32 getLnaGain();
|
||||
void setLnaGain(qint32 lna_gain);
|
||||
|
||||
qint32 getVgaGain();
|
||||
void setVgaGain(qint32 vga_gain);
|
||||
|
||||
qint32 getLog2Decim();
|
||||
void setLog2Decim(qint32 log2_decim);
|
||||
|
||||
qint32 getFcPos();
|
||||
void setFcPos(qint32 fc_pos);
|
||||
|
||||
qint32 getDevSampleRate();
|
||||
void setDevSampleRate(qint32 dev_sample_rate);
|
||||
|
||||
qint32 getBiasT();
|
||||
void setBiasT(qint32 bias_t);
|
||||
|
||||
qint32 getLnaExt();
|
||||
void setLnaExt(qint32 lna_ext);
|
||||
|
||||
qint32 getDcBlock();
|
||||
void setDcBlock(qint32 dc_block);
|
||||
|
||||
qint32 getIqCorrection();
|
||||
void setIqCorrection(qint32 iq_correction);
|
||||
|
||||
qint32 getLinkTxFrequency();
|
||||
void setLinkTxFrequency(qint32 link_tx_frequency);
|
||||
|
||||
|
||||
private:
|
||||
qint64 center_frequency;
|
||||
qint32 l_oppm_tenths;
|
||||
qint32 bandwidth;
|
||||
qint32 lna_gain;
|
||||
qint32 vga_gain;
|
||||
qint32 log2_decim;
|
||||
qint32 fc_pos;
|
||||
qint32 dev_sample_rate;
|
||||
qint32 bias_t;
|
||||
qint32 lna_ext;
|
||||
qint32 dc_block;
|
||||
qint32 iq_correction;
|
||||
qint32 link_tx_frequency;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGHackRFInputSettings_H_ */
|
190
swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp
Normal file
190
swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp
Normal file
@ -0,0 +1,190 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "SWGHackRFOutputSettings.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGHackRFOutputSettings::SWGHackRFOutputSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings::SWGHackRFOutputSettings() {
|
||||
init();
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings::~SWGHackRFOutputSettings() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFOutputSettings::init() {
|
||||
center_frequency = 0L;
|
||||
l_oppm_tenths = 0;
|
||||
bandwidth = 0;
|
||||
vga_gain = 0;
|
||||
log2_interp = 0;
|
||||
dev_sample_rate = 0;
|
||||
bias_t = 0;
|
||||
lna_ext = 0;
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFOutputSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGHackRFOutputSettings*
|
||||
SWGHackRFOutputSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGHackRFOutputSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", "");
|
||||
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&vga_gain, pJson["vgaGain"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&bias_t, pJson["biasT"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&lna_ext, pJson["lnaExt"], "qint32", "");
|
||||
}
|
||||
|
||||
QString
|
||||
SWGHackRFOutputSettings::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGHackRFOutputSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
|
||||
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
|
||||
|
||||
obj->insert("bandwidth", QJsonValue(bandwidth));
|
||||
|
||||
obj->insert("vgaGain", QJsonValue(vga_gain));
|
||||
|
||||
obj->insert("log2Interp", QJsonValue(log2_interp));
|
||||
|
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate));
|
||||
|
||||
obj->insert("biasT", QJsonValue(bias_t));
|
||||
|
||||
obj->insert("lnaExt", QJsonValue(lna_ext));
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint64
|
||||
SWGHackRFOutputSettings::getCenterFrequency() {
|
||||
return center_frequency;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setCenterFrequency(qint64 center_frequency) {
|
||||
this->center_frequency = center_frequency;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getLOppmTenths() {
|
||||
return l_oppm_tenths;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setLOppmTenths(qint32 l_oppm_tenths) {
|
||||
this->l_oppm_tenths = l_oppm_tenths;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getBandwidth() {
|
||||
return bandwidth;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setBandwidth(qint32 bandwidth) {
|
||||
this->bandwidth = bandwidth;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getVgaGain() {
|
||||
return vga_gain;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setVgaGain(qint32 vga_gain) {
|
||||
this->vga_gain = vga_gain;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getLog2Interp() {
|
||||
return log2_interp;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setLog2Interp(qint32 log2_interp) {
|
||||
this->log2_interp = log2_interp;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getDevSampleRate() {
|
||||
return dev_sample_rate;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setDevSampleRate(qint32 dev_sample_rate) {
|
||||
this->dev_sample_rate = dev_sample_rate;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getBiasT() {
|
||||
return bias_t;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setBiasT(qint32 bias_t) {
|
||||
this->bias_t = bias_t;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGHackRFOutputSettings::getLnaExt() {
|
||||
return lna_ext;
|
||||
}
|
||||
void
|
||||
SWGHackRFOutputSettings::setLnaExt(qint32 lna_ext) {
|
||||
this->lna_ext = lna_ext;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
82
swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h
Normal file
82
swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * Preset import and export from/to file is a server only feature. * The following channels are not implemented (status 501 is returned): ATV demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
|
||||
*
|
||||
* OpenAPI spec version: 4.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGHackRFOutputSettings.h
|
||||
*
|
||||
* HackRF
|
||||
*/
|
||||
|
||||
#ifndef SWGHackRFOutputSettings_H_
|
||||
#define SWGHackRFOutputSettings_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWGHackRFOutputSettings: public SWGObject {
|
||||
public:
|
||||
SWGHackRFOutputSettings();
|
||||
SWGHackRFOutputSettings(QString* json);
|
||||
virtual ~SWGHackRFOutputSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
QString asJson ();
|
||||
QJsonObject* asJsonObject();
|
||||
void fromJsonObject(QJsonObject &json);
|
||||
SWGHackRFOutputSettings* fromJson(QString &jsonString);
|
||||
|
||||
qint64 getCenterFrequency();
|
||||
void setCenterFrequency(qint64 center_frequency);
|
||||
|
||||
qint32 getLOppmTenths();
|
||||
void setLOppmTenths(qint32 l_oppm_tenths);
|
||||
|
||||
qint32 getBandwidth();
|
||||
void setBandwidth(qint32 bandwidth);
|
||||
|
||||
qint32 getVgaGain();
|
||||
void setVgaGain(qint32 vga_gain);
|
||||
|
||||
qint32 getLog2Interp();
|
||||
void setLog2Interp(qint32 log2_interp);
|
||||
|
||||
qint32 getDevSampleRate();
|
||||
void setDevSampleRate(qint32 dev_sample_rate);
|
||||
|
||||
qint32 getBiasT();
|
||||
void setBiasT(qint32 bias_t);
|
||||
|
||||
qint32 getLnaExt();
|
||||
void setLnaExt(qint32 lna_ext);
|
||||
|
||||
|
||||
private:
|
||||
qint64 center_frequency;
|
||||
qint32 l_oppm_tenths;
|
||||
qint32 bandwidth;
|
||||
qint32 vga_gain;
|
||||
qint32 log2_interp;
|
||||
qint32 dev_sample_rate;
|
||||
qint32 bias_t;
|
||||
qint32 lna_ext;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGHackRFOutputSettings_H_ */
|
@ -30,6 +30,8 @@
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGErrorResponse.h"
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGHackRFInputSettings.h"
|
||||
#include "SWGHackRFOutputSettings.h"
|
||||
#include "SWGInstanceChannelsResponse.h"
|
||||
#include "SWGInstanceDevicesResponse.h"
|
||||
#include "SWGInstanceSummaryResponse.h"
|
||||
@ -101,6 +103,12 @@ namespace SWGSDRangel {
|
||||
if(QString("SWGFileSourceSettings").compare(type) == 0) {
|
||||
return new SWGFileSourceSettings();
|
||||
}
|
||||
if(QString("SWGHackRFInputSettings").compare(type) == 0) {
|
||||
return new SWGHackRFInputSettings();
|
||||
}
|
||||
if(QString("SWGHackRFOutputSettings").compare(type) == 0) {
|
||||
return new SWGHackRFOutputSettings();
|
||||
}
|
||||
if(QString("SWGInstanceChannelsResponse").compare(type) == 0) {
|
||||
return new SWGInstanceChannelsResponse();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user