1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-01-07 08:48:47 -05:00

LoRa demod: REST API

This commit is contained in:
f4exb 2020-02-23 16:33:21 +01:00
parent 9aaa4756a2
commit 33f066c1c1
34 changed files with 3141 additions and 146 deletions

View File

@ -30,6 +30,7 @@ set(lora_HEADERS
)
include_directories(
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
add_library(demodlora SHARED
@ -40,7 +41,8 @@ target_link_libraries(demodlora
Qt5::Core
Qt5::Widgets
sdrbase
sdrgui
sdrgui
swagger
)
install(TARGETS demodlora DESTINATION ${INSTALL_PLUGINS_DIR})

View File

@ -23,9 +23,17 @@
#include <QTime>
#include <QDebug>
#include <QThread>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QBuffer>
#include "dsp/dspcommands.h"
#include "device/deviceapi.h"
#include "util/db.h"
#include "SWGChannelSettings.h"
#include "SWGChannelReport.h"
#include "SWGLoRaDemodReport.h"
#include "lorademodmsg.h"
#include "lorademod.h"
@ -40,7 +48,20 @@ const QString LoRaDemod::m_channelId = "LoRaDemod";
LoRaDemod::LoRaDemod(DeviceAPI* deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI),
m_basebandSampleRate(0)
m_basebandSampleRate(0),
m_lastMsgSignalDb(0.0),
m_lastMsgNoiseDb(0.0),
m_lastMsgSyncWord(0),
m_lastMsgPacketLength(0),
m_lastMsgNbParityBits(0),
m_lastMsgHasCRC(false),
m_lastMsgNbSymbols(0),
m_lastMsgNbCodewords(0),
m_lastMsgEarlyEOM(false),
m_lastMsgHeaderCRC(false),
m_lastMsgHeaderParityStatus(0),
m_lastMsgPayloadCRC(false),
m_lastMsgPayloadParityStatus(0)
{
setObjectName(m_channelId);
@ -104,42 +125,62 @@ bool LoRaDemod::handleMessage(const Message& cmd)
{
qDebug() << "LoRaDemod::handleMessage: MsgDecodeSymbols";
LoRaDemodMsg::MsgDecodeSymbols& msg = (LoRaDemodMsg::MsgDecodeSymbols&) cmd;
m_lastMsgSignalDb = msg.getSingalDb();
m_lastMsgNoiseDb = msg.getNoiseDb();
m_lastMsgSyncWord = msg.getSyncWord();
if (m_settings.m_codingScheme == LoRaDemodSettings::CodingLoRa)
{
QByteArray payload;
m_decoder.decodeSymbols(msg.getSymbols(), payload);
m_decoder.decodeSymbols(msg.getSymbols(), m_lastMsgBytes);
QDateTime dt = QDateTime::currentDateTime();
m_lastMsgTimestamp = dt.toString(Qt::ISODateWithMs);
m_lastMsgPacketLength = m_decoder.getPacketLength();
m_lastMsgNbParityBits = m_decoder.getNbParityBits();
m_lastMsgHasCRC = m_decoder.getHasCRC();
m_lastMsgNbSymbols = m_decoder.getNbSymbols();
m_lastMsgNbCodewords = m_decoder.getNbCodewords();
m_lastMsgEarlyEOM = m_decoder.getEarlyEOM();
m_lastMsgHeaderCRC = m_decoder.getHeaderCRCStatus();
m_lastMsgHeaderParityStatus = m_decoder.getHeaderParityStatus();
m_lastMsgPayloadCRC = m_decoder.getPayloadCRCStatus();
m_lastMsgPayloadParityStatus = m_decoder.getPayloadParityStatus();
QByteArray bytesCopy(m_lastMsgBytes);
bytesCopy.truncate(m_lastMsgPacketLength);
bytesCopy.replace('\0', " ");
m_lastMsgString = QString(bytesCopy.toStdString().c_str());
if (getMessageQueueToGUI())
{
MsgReportDecodeBytes *msgToGUI = MsgReportDecodeBytes::create(payload);
msgToGUI->setSyncWord(msg.getSyncWord());
msgToGUI->setSignalDb(msg.getSingalDb());
msgToGUI->setNoiseDb(msg.getNoiseDb());
msgToGUI->setPacketSize(m_decoder.getPacketLength());
msgToGUI->setNbParityBits(m_decoder.getNbParityBits());
msgToGUI->setHasCRC(m_decoder.getHasCRC());
msgToGUI->setNbSymbols(m_decoder.getNbSymbols());
msgToGUI->setNbCodewords(m_decoder.getNbCodewords());
msgToGUI->setEarlyEOM(m_decoder.getEarlyEOM());
msgToGUI->setHeaderParityStatus(m_decoder.getHeaderParityStatus());
msgToGUI->setHeaderCRCStatus(m_decoder.getHeaderCRCStatus());
msgToGUI->setPayloadParityStatus(m_decoder.getPayloadParityStatus());
msgToGUI->setPayloadCRCStatus(m_decoder.getPayloadCRCStatus());
MsgReportDecodeBytes *msgToGUI = MsgReportDecodeBytes::create(m_lastMsgBytes);
msgToGUI->setSyncWord(m_lastMsgSyncWord);
msgToGUI->setSignalDb(m_lastMsgSignalDb);
msgToGUI->setNoiseDb(m_lastMsgNoiseDb);
msgToGUI->setPacketSize(m_lastMsgPacketLength);
msgToGUI->setNbParityBits(m_lastMsgNbParityBits);
msgToGUI->setHasCRC(m_lastMsgHasCRC);
msgToGUI->setNbSymbols(m_lastMsgNbSymbols);
msgToGUI->setNbCodewords(m_lastMsgNbCodewords);
msgToGUI->setEarlyEOM(m_lastMsgEarlyEOM);
msgToGUI->setHeaderParityStatus(m_lastMsgHeaderParityStatus);
msgToGUI->setHeaderCRCStatus(m_lastMsgHeaderCRC);
msgToGUI->setPayloadParityStatus(m_lastMsgPayloadParityStatus);
msgToGUI->setPayloadCRCStatus(m_lastMsgPayloadCRC);
getMessageQueueToGUI()->push(msgToGUI);
}
}
else
{
QString payload;
m_decoder.decodeSymbols(msg.getSymbols(), payload);
m_decoder.decodeSymbols(msg.getSymbols(), m_lastMsgString);
QDateTime dt = QDateTime::currentDateTime();
m_lastMsgTimestamp = dt.toString(Qt::ISODateWithMs);
if (getMessageQueueToGUI())
{
MsgReportDecodeString *msgToGUI = MsgReportDecodeString::create(payload);
msgToGUI->setSyncWord(msg.getSyncWord());
msgToGUI->setSignalDb(msg.getSingalDb());
msgToGUI->setNoiseDb(msg.getNoiseDb());
MsgReportDecodeString *msgToGUI = MsgReportDecodeString::create(m_lastMsgString);
msgToGUI->setSyncWord(m_lastMsgSyncWord);
msgToGUI->setSignalDb(m_lastMsgSignalDb);
msgToGUI->setNoiseDb(m_lastMsgNoiseDb);
getMessageQueueToGUI()->push(msgToGUI);
}
}
@ -207,38 +248,393 @@ void LoRaDemod::applySettings(const LoRaDemodSettings& settings, bool force)
<< " m_title: " << settings.m_title
<< " force: " << force;
QList<QString> reverseAPIKeys;
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");
}
if ((settings.m_bandwidthIndex != m_settings.m_bandwidthIndex) || force) {
reverseAPIKeys.append("bandwidthIndex");
}
if ((settings.m_spreadFactor != m_settings.m_spreadFactor) || force) {
reverseAPIKeys.append("spreadFactor");
}
if ((settings.m_deBits != m_settings.m_deBits) || force) {
reverseAPIKeys.append("deBits");
}
if ((settings.m_spreadFactor != m_settings.m_spreadFactor)
|| (settings.m_deBits != m_settings.m_deBits) || force) {
m_decoder.setNbSymbolBits(settings.m_spreadFactor, settings.m_deBits);
}
if ((settings.m_codingScheme != m_settings.m_codingScheme) || force) {
if ((settings.m_codingScheme != m_settings.m_codingScheme) || force)
{
reverseAPIKeys.append("codingScheme");
m_decoder.setCodingScheme(settings.m_codingScheme);
}
if ((settings.m_hasHeader != m_settings.m_hasHeader) || force) {
if ((settings.m_hasHeader != m_settings.m_hasHeader) || force)
{
reverseAPIKeys.append("hasHeader");
m_decoder.setLoRaHasHeader(settings.m_hasHeader);
}
if ((settings.m_hasCRC != m_settings.m_hasCRC) || force) {
if ((settings.m_hasCRC != m_settings.m_hasCRC) || force)
{
reverseAPIKeys.append("hasCRC");
m_decoder.setLoRaHasCRC(settings.m_hasCRC);
}
if ((settings.m_nbParityBits != m_settings.m_nbParityBits) || force) {
if ((settings.m_nbParityBits != m_settings.m_nbParityBits) || force)
{
reverseAPIKeys.append("nbParityBits");
m_decoder.setLoRaParityBits(settings.m_nbParityBits);
}
if ((settings.m_packetLength != m_settings.m_packetLength) || force) {
if ((settings.m_packetLength != m_settings.m_packetLength) || force)
{
reverseAPIKeys.append("packetLength");
m_decoder.setLoRaPacketLength(settings.m_packetLength);
}
if ((settings.m_decodeActive != m_settings.m_decodeActive) || force) {
reverseAPIKeys.append("decodeActive");
}
if ((settings.m_eomSquelchTenths != m_settings.m_eomSquelchTenths) || force) {
reverseAPIKeys.append("eomSquelchTenths");
}
if ((settings.m_nbSymbolsMax != m_settings.m_nbSymbolsMax) || force) {
reverseAPIKeys.append("nbSymbolsMax");
}
if ((settings.m_preambleChirps != m_settings.m_preambleChirps) || force) {
reverseAPIKeys.append("preambleChirps");
}
if ((settings.m_rgbColor != m_settings.m_rgbColor) || force) {
reverseAPIKeys.append("rgbColor");
}
if ((settings.m_title != m_settings.m_title) || force) {
reverseAPIKeys.append("title");
}
if (m_settings.m_streamIndex != settings.m_streamIndex)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");
}
LoRaDemodBaseband::MsgConfigureLoRaDemodBaseband *msg = LoRaDemodBaseband::MsgConfigureLoRaDemodBaseband::create(settings, force);
m_basebandSink->getInputMessageQueue()->push(msg);
if (settings.m_useReverseAPI)
{
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) ||
(m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex);
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
}
m_settings = settings;
}
int LoRaDemod::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setLoRaDemodSettings(new SWGSDRangel::SWGLoRaDemodSettings());
response.getLoRaDemodSettings()->init();
webapiFormatChannelSettings(response, m_settings);
return 200;
}
int LoRaDemod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
LoRaDemodSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureLoRaDemod *msg = MsgConfigureLoRaDemod::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureLoRaDemod *msgToGUI = MsgConfigureLoRaDemod::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatChannelSettings(response, settings);
return 200;
}
void LoRaDemod::webapiUpdateChannelSettings(
LoRaDemodSettings& settings,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response)
{
if (channelSettingsKeys.contains("inputFrequencyOffset")) {
settings.m_inputFrequencyOffset = response.getLoRaDemodSettings()->getInputFrequencyOffset();
}
if (channelSettingsKeys.contains("bandwidthIndex")) {
settings.m_bandwidthIndex = response.getLoRaDemodSettings()->getBandwidthIndex();
}
if (channelSettingsKeys.contains("spreadFactor")) {
settings.m_spreadFactor = response.getLoRaDemodSettings()->getSpreadFactor();
}
if (channelSettingsKeys.contains("deBits")) {
settings.m_deBits = response.getLoRaDemodSettings()->getDeBits();
}
if (channelSettingsKeys.contains("codingScheme")) {
settings.m_codingScheme = (LoRaDemodSettings::CodingScheme) response.getLoRaDemodSettings()->getCodingScheme();
}
if (channelSettingsKeys.contains("decodeActive")) {
settings.m_decodeActive = response.getLoRaDemodSettings()->getDecodeActive() != 0;
}
if (channelSettingsKeys.contains("eomSquelchTenths")) {
settings.m_eomSquelchTenths = response.getLoRaDemodSettings()->getEomSquelchTenths();
}
if (channelSettingsKeys.contains("nbSymbolsMax")) {
settings.m_nbSymbolsMax = response.getLoRaDemodSettings()->getNbSymbolsMax();
}
if (channelSettingsKeys.contains("preambleChirps")) {
settings.m_preambleChirps = response.getLoRaDemodSettings()->getPreambleChirps();
}
if (channelSettingsKeys.contains("nbParityBits")) {
settings.m_nbParityBits = response.getLoRaDemodSettings()->getNbParityBits();
}
if (channelSettingsKeys.contains("packetLength")) {
settings.m_packetLength = response.getLoRaDemodSettings()->getPacketLength();
}
if (channelSettingsKeys.contains("hasCRC")) {
settings.m_hasCRC = response.getLoRaDemodSettings()->getHasCrc() != 0;
}
if (channelSettingsKeys.contains("hasHeader")) {
settings.m_hasHeader = response.getLoRaDemodSettings()->getHasHeader() != 0;
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getLoRaDemodSettings()->getRgbColor();
}
if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getLoRaDemodSettings()->getTitle();
}
if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getLoRaDemodSettings()->getStreamIndex();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getLoRaDemodSettings()->getUseReverseApi() != 0;
}
if (channelSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getLoRaDemodSettings()->getReverseApiAddress();
}
if (channelSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getLoRaDemodSettings()->getReverseApiPort();
}
if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
settings.m_reverseAPIDeviceIndex = response.getLoRaDemodSettings()->getReverseApiDeviceIndex();
}
if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
settings.m_reverseAPIChannelIndex = response.getLoRaDemodSettings()->getReverseApiChannelIndex();
}
}
int LoRaDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
(void) errorMessage;
response.setLoRaDemodReport(new SWGSDRangel::SWGLoRaDemodReport());
response.getLoRaDemodReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void LoRaDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const LoRaDemodSettings& settings)
{
response.getLoRaDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getLoRaDemodSettings()->setBandwidthIndex(settings.m_bandwidthIndex);
response.getLoRaDemodSettings()->setSpreadFactor(settings.m_spreadFactor);
response.getLoRaDemodSettings()->setDeBits(settings.m_deBits);
response.getLoRaDemodSettings()->setCodingScheme((int) settings.m_codingScheme);
response.getLoRaDemodSettings()->setDecodeActive(settings.m_decodeActive ? 1 : 0);
response.getLoRaDemodSettings()->setEomSquelchTenths(settings.m_eomSquelchTenths);
response.getLoRaDemodSettings()->setNbSymbolsMax(settings.m_nbSymbolsMax);
response.getLoRaDemodSettings()->setPreambleChirps(settings.m_preambleChirps);
response.getLoRaDemodSettings()->setNbParityBits(settings.m_nbParityBits);
response.getLoRaDemodSettings()->setHasCrc(settings.m_hasCRC ? 1 : 0);
response.getLoRaDemodSettings()->setHasHeader(settings.m_hasHeader ? 1 : 0);
response.getLoRaDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getLoRaDemodSettings()->getTitle()) {
*response.getLoRaDemodSettings()->getTitle() = settings.m_title;
} else {
response.getLoRaDemodSettings()->setTitle(new QString(settings.m_title));
}
response.getLoRaDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getLoRaDemodSettings()->getReverseApiAddress()) {
*response.getLoRaDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getLoRaDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getLoRaDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getLoRaDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
response.getLoRaDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
}
void LoRaDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
response.getLoRaDemodReport()->setChannelPowerDb(CalcDb::dbPower(getTotalPower()));
response.getLoRaDemodReport()->setSignalPowerDb(m_lastMsgSignalDb);
response.getLoRaDemodReport()->setNoisePowerDb(CalcDb::dbPower(getCurrentNoiseLevel()));
response.getLoRaDemodReport()->setSnrPowerDb(m_lastMsgSignalDb - m_lastMsgNoiseDb);
response.getLoRaDemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
response.getLoRaDemodReport()->setHasCrc(m_lastMsgHasCRC);
response.getLoRaDemodReport()->setNbParityBits(m_lastMsgNbParityBits);
response.getLoRaDemodReport()->setPacketLength(m_lastMsgPacketLength);
response.getLoRaDemodReport()->setNbSymbols(m_lastMsgNbSymbols);
response.getLoRaDemodReport()->setNbCodewords(m_lastMsgNbCodewords);
response.getLoRaDemodReport()->setHeaderParityStatus(m_lastMsgHeaderParityStatus);
response.getLoRaDemodReport()->setHeaderCrcStatus(m_lastMsgHeaderCRC);
response.getLoRaDemodReport()->setPayloadParityStatus(m_lastMsgPayloadParityStatus);
response.getLoRaDemodReport()->setPayloadCrcStatus(m_lastMsgPayloadCRC);
response.getLoRaDemodReport()->setMessageTimestamp(new QString(m_lastMsgTimestamp));
response.getLoRaDemodReport()->setMessageString(new QString(m_lastMsgString));
response.getLoRaDemodReport()->setMessageBytes(new QList<QString *>);
QList<QString *> *bytesStr = response.getLoRaDemodReport()->getMessageBytes();
for (QByteArray::const_iterator it = m_lastMsgBytes.begin(); it != m_lastMsgBytes.end(); ++it)
{
unsigned char b = *it;
bytesStr->push_back(new QString(tr("%1").arg(b, 2, 16, QChar('0'))));
}
}
void LoRaDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const LoRaDemodSettings& settings, bool force)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
swgChannelSettings->setDirection(1); // single source (Tx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("LoRaMod"));
swgChannelSettings->setLoRaModSettings(new SWGSDRangel::SWGLoRaModSettings());
SWGSDRangel::SWGLoRaDemodSettings *swgLoRaDemodSettings = swgChannelSettings->getLoRaDemodSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgLoRaDemodSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("bandwidthIndex") || force) {
swgLoRaDemodSettings->setBandwidthIndex(settings.m_bandwidthIndex);
}
if (channelSettingsKeys.contains("spreadFactor") || force) {
swgLoRaDemodSettings->setSpreadFactor(settings.m_spreadFactor);
}
if (channelSettingsKeys.contains("deBits") || force) {
swgLoRaDemodSettings->setDeBits(settings.m_deBits);
}
if (channelSettingsKeys.contains("codingScheme") || force) {
swgLoRaDemodSettings->setCodingScheme((int) settings.m_codingScheme);
}
if (channelSettingsKeys.contains("decodeActive") || force) {
swgLoRaDemodSettings->setDecodeActive(settings.m_decodeActive ? 1 : 0);
}
if (channelSettingsKeys.contains("decodeActive") || force) {
swgLoRaDemodSettings->setEomSquelchTenths(settings.m_eomSquelchTenths ? 1 : 0);
}
if (channelSettingsKeys.contains("decodeActive") || force) {
swgLoRaDemodSettings->setNbSymbolsMax(settings.m_nbSymbolsMax ? 1 : 0);
}
if (channelSettingsKeys.contains("preambleChirps") || force) {
swgLoRaDemodSettings->setPreambleChirps(settings.m_preambleChirps);
}
if (channelSettingsKeys.contains("nbParityBits") || force) {
swgLoRaDemodSettings->setNbParityBits(settings.m_nbParityBits);
}
if (channelSettingsKeys.contains("hasCRC") || force) {
swgLoRaDemodSettings->setHasCrc(settings.m_hasCRC ? 1 : 0);
}
if (channelSettingsKeys.contains("hasHeader") || force) {
swgLoRaDemodSettings->setHasHeader(settings.m_hasHeader ? 1 : 0);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgLoRaDemodSettings->setRgbColor(settings.m_rgbColor);
}
if (channelSettingsKeys.contains("title") || force) {
swgLoRaDemodSettings->setTitle(new QString(settings.m_title));
}
QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
.arg(settings.m_reverseAPIAddress)
.arg(settings.m_reverseAPIPort)
.arg(settings.m_reverseAPIDeviceIndex)
.arg(settings.m_reverseAPIChannelIndex);
m_networkRequest.setUrl(QUrl(channelSettingsURL));
m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QBuffer *buffer = new QBuffer();
buffer->open((QBuffer::ReadWrite));
buffer->write(swgChannelSettings->asJson().toUtf8());
buffer->seek(0);
// Always use PATCH to avoid passing reverse API settings
QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
buffer->setParent(reply);
delete swgChannelSettings;
}
void LoRaDemod::networkManagerFinished(QNetworkReply *reply)
{
QNetworkReply::NetworkError replyError = reply->error();
if (replyError)
{
qWarning() << "LoRaDemod::networkManagerFinished:"
<< " error(" << (int) replyError
<< "): " << replyError
<< ": " << reply->errorString();
}
else
{
QString answer = reply->readAll();
answer.chop(1); // remove last \n
qDebug("LoRaDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
}
reply->deleteLater();
}
bool LoRaDemod::getDemodActive() const
{
return m_basebandSink->getDemodActive();
}
double LoRaDemod::getCurrentNoiseLevel() const
{
return m_basebandSink->getCurrentNoiseLevel();
}
double LoRaDemod::getTotalPower() const
{
return m_basebandSink->getTotalPower();
}

View File

@ -22,6 +22,8 @@
#include <vector>
#include <QNetworkRequest>
#include "dsp/basebandsamplesink.h"
#include "channel/channelapi.h"
#include "util/message.h"
@ -29,6 +31,8 @@
#include "lorademodbaseband.h"
#include "lorademoddecoder.h"
class QNetworkAccessManager;
class QNetworkReply;
class DeviceAPI;
class QThread;
@ -219,7 +223,32 @@ public:
return 0;
}
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response,
const LoRaDemodSettings& settings);
static void webapiUpdateChannelSettings(
LoRaDemodSettings& settings,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response);
bool getDemodActive() const;
double getCurrentNoiseLevel() const;
double getTotalPower() const;
static const QString m_channelIdURI;
static const QString m_channelId;
@ -231,8 +260,32 @@ private:
LoRaDemodDecoder m_decoder;
LoRaDemodSettings m_settings;
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
float m_lastMsgSignalDb;
float m_lastMsgNoiseDb;
int m_lastMsgSyncWord;
int m_lastMsgPacketLength;
int m_lastMsgNbParityBits;
bool m_lastMsgHasCRC;
int m_lastMsgNbSymbols;
int m_lastMsgNbCodewords;
bool m_lastMsgEarlyEOM;
bool m_lastMsgHeaderCRC;
int m_lastMsgHeaderParityStatus;
bool m_lastMsgPayloadCRC;
int m_lastMsgPayloadParityStatus;
QString m_lastMsgTimestamp;
QString m_lastMsgString;
QByteArray m_lastMsgBytes;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
void applySettings(const LoRaDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const LoRaDemodSettings& settings, bool force);
private slots:
void networkManagerFinished(QNetworkReply *reply);
};
#endif // INCLUDE_LORADEMOD_H

View File

@ -63,6 +63,8 @@ public:
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
int getChannelSampleRate() const;
bool getDemodActive() const { return m_sink.getDemodActive(); }
double getCurrentNoiseLevel() const { return m_sink.getCurrentNoiseLevel(); }
double getTotalPower() const { return m_sink.getTotalPower(); }
void setBasebandSampleRate(int sampleRate);
void setDecoderMessageQueue(MessageQueue *messageQueue) { m_sink.setDecoderMessageQueue(messageQueue); }
void setSpectrumSink(BasebandSampleSink* spectrumSink) { m_sink.setSpectrumSink(spectrumSink); }

View File

@ -27,6 +27,7 @@
#include "gui/glspectrumgui.h"
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "util/db.h"
#include "mainwindow.h"
#include "lorademod.h"
@ -494,8 +495,9 @@ void LoRaDemodGUI::showLoRaMessage(const Message& message)
{
const LoRaDemod::MsgReportDecodeBytes& msg = (LoRaDemod::MsgReportDecodeBytes&) message;
QByteArray bytes = msg.getBytes();
QString syncWordStr((tr("%1").arg(msg.getSyncWord(), 2, 16, QChar('0'))));
ui->syncWord->setText((tr("%1").arg(msg.getSyncWord(), 2, 16)));
ui->syncWord->setText(tr("%1").arg(syncWordStr));
ui->sText->setText(tr("%1").arg(msg.getSingalDb(), 0, 'f', 1));
ui->snrText->setText(tr("%1").arg(msg.getSingalDb() - msg.getNoiseDb(), 0, 'f', 1));
unsigned int packetLength;
@ -521,7 +523,7 @@ void LoRaDemodGUI::showLoRaMessage(const Message& message)
{
QString loRaStatus = tr("%1 %2 S:%3 SN:%4 HF:%5 HC:%6 EOM:too early")
.arg(dateStr)
.arg(msg.getSyncWord(), 2, 16)
.arg(syncWordStr)
.arg(msg.getSingalDb(), 0, 'f', 1)
.arg(msg.getSingalDb() - msg.getNoiseDb(), 0, 'f', 1)
.arg(getParityStr(msg.getHeaderParityStatus()))
@ -535,7 +537,7 @@ void LoRaDemodGUI::showLoRaMessage(const Message& message)
{
QString loRaHeader = tr("%1 %2 S:%3 SN:%4 HF:%5 HC:%6 FEC:%7 CRC:%8")
.arg(dateStr)
.arg(msg.getSyncWord(), 2, 16)
.arg(syncWordStr)
.arg(msg.getSingalDb(), 0, 'f', 1)
.arg(msg.getSingalDb() - msg.getNoiseDb(), 0, 'f', 1)
.arg(getParityStr(msg.getHeaderParityStatus()))
@ -549,8 +551,9 @@ void LoRaDemodGUI::showLoRaMessage(const Message& message)
bytesCopy.truncate(packetLength);
bytesCopy.replace('\0', " ");
QString str = QString(bytesCopy.toStdString().c_str());
displayText(dateStr, str);
QString textHeader(tr("%1 (%2)").arg(dateStr).arg(syncWordStr));
displayText(textHeader, str);
displayLoRaStatus(msg.getHeaderParityStatus(), msg.getHeaderCRCStatus(), msg.getPayloadParityStatus(), msg.getPayloadCRCStatus());
}
@ -564,8 +567,10 @@ void LoRaDemodGUI::showTextMessage(const Message& message)
QDateTime dt = QDateTime::currentDateTime();
QString dateStr = dt.toString("HH:mm:ss");
displayText(dateStr, msg.getString());
ui->syncWord->setText((tr("%1").arg(msg.getSyncWord(), 2, 16)));
QString syncWordStr((tr("%1").arg(msg.getSyncWord(), 2, 16, QChar('0'))));
QString textHeader(tr("%1 (%2)").arg(dateStr).arg(syncWordStr));
displayText(textHeader, msg.getString());
ui->syncWord->setText(syncWordStr);
ui->sText->setText(tr("%1").arg(msg.getSingalDb(), 0, 'f', 1));
ui->snrText->setText(tr("%1").arg(msg.getSingalDb() - msg.getNoiseDb(), 0, 'f', 1));
@ -608,7 +613,7 @@ void LoRaDemodGUI::displayBytes(const QString& header, const QByteArray& bytes)
cursor.insertText(tr("%1|").arg(i, 3, 10, QChar('0')));
}
cursor.insertText(tr("%1").arg(b, 2, 16));
cursor.insertText(tr("%1").arg(b, 2, 16, QChar('0')));
if (i%16 == 15) {
cursor.insertText("\n");
@ -658,6 +663,9 @@ void LoRaDemodGUI::tick()
{
m_tickCount = 0;
ui->nText->setText(tr("%1").arg(CalcDb::dbPower(m_LoRaDemod->getCurrentNoiseLevel()), 0, 'f', 1));
ui->channelPower->setText(tr("%1 dB").arg(CalcDb::dbPower(m_LoRaDemod->getTotalPower()), 0, 'f', 1));
if (m_LoRaDemod->getDemodActive()) {
ui->mute->setStyleSheet("QToolButton { background-color : green; }");
} else {

View File

@ -6,13 +6,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>512</width>
<width>532</width>
<height>660</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>512</width>
<width>532</width>
<height>660</height>
</size>
</property>
@ -30,7 +30,7 @@
<rect>
<x>1</x>
<y>20</y>
<width>510</width>
<width>530</width>
<height>90</height>
</rect>
</property>
@ -74,7 +74,7 @@
<rect>
<x>30</x>
<y>50</y>
<width>381</width>
<width>231</width>
<height>16</height>
</rect>
</property>
@ -153,20 +153,14 @@
<widget class="QLabel" name="BWText">
<property name="geometry">
<rect>
<x>420</x>
<x>269</x>
<y>50</y>
<width>80</width>
<width>70</width>
<height>16</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>7813 Hz</string>
<string>500000 Hz</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -243,7 +237,7 @@
<rect>
<x>10</x>
<y>10</y>
<width>491</width>
<width>511</width>
<height>26</height>
</rect>
</property>
@ -320,73 +314,27 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="sLabel">
<property name="text">
<string>S</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sText">
<widget class="QLabel" name="channelPower">
<property name="minimumSize">
<size>
<width>30</width>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>De-chirped signal level</string>
<string>De-chirped channel power</string>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>-50.0</string>
<string>-100.0 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="snrLabel">
<property name="minimumSize">
<size>
<width>35</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>SNR</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="snrText">
<property name="minimumSize">
<size>
<width>25</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>De-chirped SNR level</string>
</property>
<property name="text">
<string>10.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sUnits">
<property name="text">
<string>dB</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="preambleChirpsText">
@ -455,13 +403,140 @@
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="sUnits">
<property name="geometry">
<rect>
<x>500</x>
<y>50</y>
<width>20</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="snrText">
<property name="geometry">
<rect>
<x>470</x>
<y>50</y>
<width>28</width>
<height>16</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>25</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>De-chirped Signal to Noise Ratio</string>
</property>
<property name="text">
<string>-10.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="snrLabel">
<property name="geometry">
<rect>
<x>460</x>
<y>50</y>
<width>5</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>/</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="sText">
<property name="geometry">
<rect>
<x>425</x>
<y>50</y>
<width>30</width>
<height>16</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>De-chirped signal power</string>
</property>
<property name="text">
<string>-50.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="sLabel">
<property name="geometry">
<rect>
<x>410</x>
<y>50</y>
<width>9</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>S</string>
</property>
</widget>
<widget class="QLabel" name="nText">
<property name="geometry">
<rect>
<x>375</x>
<y>50</y>
<width>30</width>
<height>16</height>
</rect>
</property>
<property name="toolTip">
<string>De-chirped noise power</string>
</property>
<property name="text">
<string>-50.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="nLabel">
<property name="geometry">
<rect>
<x>360</x>
<y>50</y>
<width>10</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>N</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="payloadContainer" native="true">
<property name="geometry">
<rect>
<x>1</x>
<y>120</y>
<width>510</width>
<width>530</width>
<height>230</height>
</rect>
</property>
@ -505,7 +580,7 @@
<rect>
<x>30</x>
<y>60</y>
<width>471</width>
<width>490</width>
<height>80</height>
</rect>
</property>
@ -712,7 +787,7 @@
<widget class="QLineEdit" name="syncWord">
<property name="geometry">
<rect>
<x>480</x>
<x>492</x>
<y>10</y>
<width>25</width>
<height>20</height>
@ -832,7 +907,7 @@
<rect>
<x>30</x>
<y>145</y>
<width>471</width>
<width>490</width>
<height>75</height>
</rect>
</property>
@ -897,7 +972,7 @@
<widget class="QLabel" name="syncWordLabel">
<property name="geometry">
<rect>
<x>440</x>
<x>456</x>
<y>10</y>
<width>30</width>
<height>19</height>
@ -910,7 +985,7 @@
<widget class="QLabel" name="headerHammingStatus">
<property name="geometry">
<rect>
<x>380</x>
<x>395</x>
<y>35</y>
<width>20</width>
<height>16</height>
@ -926,7 +1001,7 @@
<widget class="QLabel" name="headerCRCStatus">
<property name="geometry">
<rect>
<x>410</x>
<x>425</x>
<y>35</y>
<width>20</width>
<height>16</height>
@ -942,7 +1017,7 @@
<widget class="QLabel" name="payloadFECStatus">
<property name="geometry">
<rect>
<x>440</x>
<x>455</x>
<y>35</y>
<width>25</width>
<height>16</height>
@ -958,7 +1033,7 @@
<widget class="QLabel" name="payloadCRCStatus">
<property name="geometry">
<rect>
<x>475</x>
<x>490</x>
<y>35</y>
<width>28</width>
<height>16</height>
@ -1031,7 +1106,7 @@
<rect>
<x>1</x>
<y>360</y>
<width>510</width>
<width>530</width>
<height>260</height>
</rect>
</property>

View File

@ -24,8 +24,33 @@
#include "settings/serializable.h"
#include "lorademodsettings.h"
const int LoRaDemodSettings::bandwidths[] = {2500, 7813, 10417, 15625, 20833, 31250, 41667, 62500, 125000, 250000, 500000};
const int LoRaDemodSettings::nbBandwidths = 11;
const int LoRaDemodSettings::bandwidths[] = {
2604, // 333k / 128
3125, // 400k / 128
3906, // 500k / 128
5208, // 333k / 64
6250, // 400k / 64
7813, // 500k / 64
10417, // 333k / 32
12500, // 400k / 32
15625, // 500k / 32
20833, // 333k / 16
25000, // 400k / 16
31250, // 500k / 16
41667, // 333k / 8
50000, // 400k / 8
62500, // 500k / 8
83333, // 333k / 4
100000, // 400k / 4
125000, // 500k / 4
166667, // 333k / 2
200000, // 400k / 2
250000, // 500k / 2
333333, // 333k / 1
400000, // 400k / 1
500000 // 500k / 1
};
const int LoRaDemodSettings::nbBandwidths = 3*8;
const int LoRaDemodSettings::oversampling = 2;
LoRaDemodSettings::LoRaDemodSettings() :
@ -52,6 +77,12 @@ void LoRaDemodSettings::resetToDefaults()
m_hasHeader = true;
m_rgbColor = QColor(255, 0, 255).rgb();
m_title = "LoRa Demodulator";
m_streamIndex = 0;
m_useReverseAPI = false;
m_reverseAPIAddress = "127.0.0.1";
m_reverseAPIPort = 8888;
m_reverseAPIDeviceIndex = 0;
m_reverseAPIChannelIndex = 0;
}
QByteArray LoRaDemodSettings::serialize() const
@ -80,6 +111,12 @@ QByteArray LoRaDemodSettings::serialize() const
s.writeBool(14, m_hasCRC);
s.writeBool(15, m_hasHeader);
s.writeS32(17, m_preambleChirps);
s.writeBool(20, m_useReverseAPI);
s.writeString(21, m_reverseAPIAddress);
s.writeU32(22, m_reverseAPIPort);
s.writeU32(23, m_reverseAPIDeviceIndex);
s.writeU32(24, m_reverseAPIChannelIndex);
s.writeS32(25, m_streamIndex);
return s.final();
}
@ -98,6 +135,7 @@ bool LoRaDemodSettings::deserialize(const QByteArray& data)
{
QByteArray bytetmp;
int tmp;
unsigned int utmp;
d.readS32(1, &m_inputFrequencyOffset, 0);
d.readS32(2, &m_bandwidthIndex, 0);
@ -126,6 +164,22 @@ bool LoRaDemodSettings::deserialize(const QByteArray& data)
d.readBool(15, &m_hasHeader, true);
d.readS32(17, &m_preambleChirps, 8);
d.readBool(20, &m_useReverseAPI, false);
d.readString(21, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(22, &utmp, 0);
if ((utmp > 1023) && (utmp < 65535)) {
m_reverseAPIPort = utmp;
} else {
m_reverseAPIPort = 8888;
}
d.readU32(23, &utmp, 0);
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
d.readU32(24, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
d.readS32(25, &m_streamIndex, 0);
return true;
}
else

View File

@ -50,6 +50,12 @@ struct LoRaDemodSettings
bool m_hasHeader; //!< Header present before actual payload (LoRa)
uint32_t m_rgbColor;
QString m_title;
int m_streamIndex;
bool m_useReverseAPI;
QString m_reverseAPIAddress;
uint16_t m_reverseAPIPort;
uint16_t m_reverseAPIDeviceIndex;
uint16_t m_reverseAPIChannelIndex;
Serializable *m_channelMarker;
Serializable *m_spectrumGUI;

View File

@ -136,6 +136,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
{
m_demodActive = false;
reset();
std::queue<double>().swap(m_magsqQueue); // this clears the queue
m_state = LoRaStateDetectPreamble;
}
else if (m_state == LoRaStateDetectPreamble) // look for preamble
@ -148,13 +149,14 @@ void LoRaDemodSink::processSample(const Complex& ci)
std::fill(m_fft->in()+m_fftLength, m_fft->in()+m_fftInterpolation*m_fftLength, Complex{0.0, 0.0});
m_fft->transform();
m_fftCounter = 0;
double magsq;
double magsq, magsqTotal;
unsigned int imax = argmax(
m_fft->out(),
m_fftInterpolation,
m_fftLength,
magsq,
magsqTotal,
m_spectrumBuffer,
m_fftInterpolation
) / m_fftInterpolation;
@ -163,6 +165,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
m_magsqQueue.pop();
}
m_magsqTotalAvg(magsqTotal);
m_magsqQueue.push(magsq);
m_argMaxHistory[m_argMaxHistoryCounter++] = imax;
@ -233,12 +236,14 @@ void LoRaDemodSink::processSample(const Complex& ci)
m_fftCounter = 0;
double magsq, magsqSFD;
double magsqTotal, magsqSFDTotal;
unsigned int imaxSFD = argmax(
m_fftSFD->out(),
m_fftInterpolation,
m_fftLength,
magsqSFD,
magsqTotal,
nullptr,
m_fftInterpolation
) / m_fftInterpolation;
@ -248,6 +253,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
m_fftInterpolation,
m_fftLength,
magsq,
magsqSFDTotal,
m_spectrumBuffer,
m_fftInterpolation
) / m_fftInterpolation;
@ -257,6 +263,8 @@ void LoRaDemodSink::processSample(const Complex& ci)
if (magsq < magsqSFD) // preamble drop
{
m_magsqTotalAvg(magsqSFDTotal);
if (m_chirpCount < 3) // too early
{
m_state = LoRaStateReset;
@ -292,6 +300,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
else if (m_chirpCount > (m_settings.m_preambleChirps - m_requiredPreambleChirps + 2)) // SFD missed start over
{
qDebug("LoRaDemodSink::processSample: SFD search: number of possible chirps exceeded");
m_magsqTotalAvg(magsqTotal);
m_state = LoRaStateReset;
}
else
@ -301,6 +310,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
}
qDebug("LoRaDemodSink::processSample: SFD search: up: %4u|%11.6f - down: %4u|%11.6f", imax, magsq, imaxSFD, magsqSFD);
m_magsqTotalAvg(magsqTotal);
m_magsqOnAvg(magsq);
}
}
@ -339,7 +349,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
std::fill(m_fft->in()+m_fftLength, m_fft->in()+m_fftInterpolation*m_fftLength, Complex{0.0, 0.0});
m_fft->transform();
m_fftCounter = 0;
double magsq;
double magsq, magsqTotal;
unsigned short symbol = evalSymbol(
argmax(
@ -347,6 +357,7 @@ void LoRaDemodSink::processSample(const Complex& ci)
m_fftInterpolation,
m_fftLength,
magsq,
magsqTotal,
m_spectrumBuffer,
m_fftInterpolation
)
@ -360,6 +371,8 @@ void LoRaDemodSink::processSample(const Complex& ci)
m_magsqMax = magsq;
}
m_magsqTotalAvg(magsq);
m_decodeMsg->pushBackSymbol(symbol);
if ((m_chirpCount == 0)
@ -426,16 +439,19 @@ unsigned int LoRaDemodSink::argmax(
unsigned int fftMult,
unsigned int fftLength,
double& magsqMax,
double& magsqTotal,
Complex *specBuffer,
unsigned int specDecim)
{
magsqMax = 0.0;
magsqTotal = 0.0;
unsigned int imax;
double magSum = 0.0;
for (unsigned int i = 0; i < fftMult*fftLength; i++)
{
double magsq = std::norm(fftBins[i]);
magsqTotal += magsq;
if (magsq > magsqMax)
{
@ -455,6 +471,8 @@ unsigned int LoRaDemodSink::argmax(
}
}
magsqTotal /= fftMult*fftLength;
return imax;
}
@ -464,11 +482,13 @@ unsigned int LoRaDemodSink::argmaxSpreaded(
unsigned int fftLength,
double& magsqMax,
double& magsqNoise,
double& magSqTotal,
Complex *specBuffer,
unsigned int specDecim)
{
magsqMax = 0.0;
magsqNoise = 0.0;
magSqTotal = 0.0;
unsigned int imax = 0;
double magSum = 0.0;
double magSymbol = 0.0;
@ -480,6 +500,7 @@ unsigned int LoRaDemodSink::argmaxSpreaded(
unsigned int i = i2 % (fftMult*fftLength);
double magsq = std::norm(fftBins[i]);
magSymbol += magsq;
magSqTotal += magsq;
if (i % spread == spread/2) // boundary (inclusive)
{
@ -507,6 +528,7 @@ unsigned int LoRaDemodSink::argmaxSpreaded(
magsqNoise -= magsqMax;
magsqNoise /= fftLength;
magSqTotal /= fftMult*fftLength;
return imax / spread;
}

View File

@ -49,6 +49,8 @@ public:
void setSpectrumSink(BasebandSampleSink* spectrumSink) { m_spectrumSink = spectrumSink; }
void applyChannelSettings(int channelSampleRate, int bandwidth, int channelFrequencyOffset, bool force = false);
void applySettings(const LoRaDemodSettings& settings, bool force = false);
double getCurrentNoiseLevel() const { return m_magsqOffAvg.instantAverage() / (1<<m_settings.m_spreadFactor); }
double getTotalPower() const { return m_magsqTotalAvg.instantAverage() / (1<<m_settings.m_spreadFactor); }
private:
enum LoRaState
@ -92,6 +94,7 @@ private:
double m_magsqMax;
MovingAverageUtil<double, double, 10> m_magsqOnAvg;
MovingAverageUtil<double, double, 10> m_magsqOffAvg;
MovingAverageUtil<double, double, 10> m_magsqTotalAvg;
std::queue<double> m_magsqQueue;
unsigned int m_chirpCount; //!< Generic chirp counter
unsigned int m_sfdSkip; //!< Number of samples in a SFD skip or slide (1/4) period
@ -117,6 +120,7 @@ private:
unsigned int fftMult,
unsigned int fftLength,
double& magsqMax,
double& magSqTotal,
Complex *specBuffer,
unsigned int specDecim
);
@ -126,6 +130,7 @@ private:
unsigned int fftLength,
double& magsqMax,
double& magsqNoise,
double& magSqTotal,
Complex *specBuffer,
unsigned int specDecim
);

View File

@ -0,0 +1,49 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2020 Edouard Griffiths, F4EXB. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "SWGChannelSettings.h"
#include "lorademod.h"
#include "lorademodwebapiadapter.h"
LoRaDemodWebAPIAdapter::LoRaDemodWebAPIAdapter()
{}
LoRaDemodWebAPIAdapter::~LoRaDemodWebAPIAdapter()
{}
int LoRaDemodWebAPIAdapter::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
response.setLoRaDemodSettings(new SWGSDRangel::SWGLoRaDemodSettings());
response.getLoRaDemodSettings()->init();
LoRaDemod::webapiFormatChannelSettings(response, m_settings);
return 200;
}
int LoRaDemodWebAPIAdapter::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
LoRaDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
LoRaDemod::webapiFormatChannelSettings(response, m_settings);
return 200;
}

View File

@ -0,0 +1,49 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2020 Edouard Griffiths, F4EXB. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_LORADEMOD_WEBAPIADAPTER_H
#define INCLUDE_LORADEMOD_WEBAPIADAPTER_H
#include "channel/channelwebapiadapter.h"
#include "lorademodsettings.h"
/**
* Standalone API adapter only for the settings
*/
class LoRaDemodWebAPIAdapter : public ChannelWebAPIAdapter {
public:
LoRaDemodWebAPIAdapter();
virtual ~LoRaDemodWebAPIAdapter();
virtual QByteArray serialize() const { return m_settings.serialize(); }
virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); }
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
private:
LoRaDemodSettings m_settings;
};
#endif // INCLUDE_LORAMOD_WEBAPIADAPTER_H

View File

@ -24,8 +24,33 @@
#include "settings/serializable.h"
#include "loramodsettings.h"
const int LoRaModSettings::bandwidths[] = {2500, 7813, 10417, 15625, 20833, 31250, 41667, 62500, 125000, 250000, 500000};
const int LoRaModSettings::nbBandwidths = 11;
const int LoRaModSettings::bandwidths[] = {
2604, // 333k / 128
3125, // 400k / 128
3906, // 500k / 128
5208, // 333k / 64
6250, // 400k / 64
7813, // 500k / 64
10417, // 333k / 32
12500, // 400k / 32
15625, // 500k / 32
20833, // 333k / 16
25000, // 400k / 16
31250, // 500k / 16
41667, // 333k / 8
50000, // 400k / 8
62500, // 500k / 8
83333, // 333k / 4
100000, // 400k / 4
125000, // 500k / 4
166667, // 333k / 2
200000, // 400k / 2
250000, // 500k / 2
333333, // 333k / 1
400000, // 400k / 1
500000 // 500k / 1
};
const int LoRaModSettings::nbBandwidths = 3*8;
const int LoRaModSettings::oversampling = 4;
LoRaModSettings::LoRaModSettings() :
@ -140,6 +165,12 @@ QByteArray LoRaModSettings::serialize() const
s.writeString(42, m_myLoc);
s.writeString(43, m_myRpt);
s.writeS32(44, m_messageRepeat);
s.writeBool(50, m_useReverseAPI);
s.writeString(51, m_reverseAPIAddress);
s.writeU32(52, m_reverseAPIPort);
s.writeU32(53, m_reverseAPIDeviceIndex);
s.writeU32(54, m_reverseAPIChannelIndex);
s.writeS32(55, m_streamIndex);
return s.final();
}
@ -214,6 +245,22 @@ bool LoRaModSettings::deserialize(const QByteArray& data)
d.readString(43, &m_myRpt, "59");
d.readS32(44, &m_messageRepeat, 1);
d.readBool(50, &m_useReverseAPI, false);
d.readString(51, &m_reverseAPIAddress, "127.0.0.1");
d.readU32(52, &utmp, 0);
if ((utmp > 1023) && (utmp < 65535)) {
m_reverseAPIPort = utmp;
} else {
m_reverseAPIPort = 8888;
}
d.readU32(53, &utmp, 0);
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
d.readU32(54, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
d.readS32(55, &m_streamIndex, 0);
return true;
}
else

View File

@ -36,6 +36,7 @@
<file>webapi/doc/swagger/include/KiwiSDR.yaml</file>
<file>webapi/doc/swagger/include/LocalInput.yaml</file>
<file>webapi/doc/swagger/include/LocalOutput.yaml</file>
<file>webapi/doc/swagger/include/LoRaDemod.yaml</file>
<file>webapi/doc/swagger/include/LoRaMod.yaml</file>
<file>webapi/doc/swagger/include/NFMDemod.yaml</file>
<file>webapi/doc/swagger/include/NFMMod.yaml</file>

View File

@ -2184,6 +2184,9 @@ margin-bottom: 20px;
"FreqTrackerReport" : {
"$ref" : "#/definitions/FreqTrackerReport"
},
"LoRaDemodReport" : {
"$ref" : "#/definitions/LoRaDemodReport"
},
"LoRaModReport" : {
"$ref" : "#/definitions/LoRaModReport"
},
@ -2279,6 +2282,9 @@ margin-bottom: 20px;
"InterferometerSettings" : {
"$ref" : "#/definitions/InterferometerSettings"
},
"LoRaDemodSettings" : {
"$ref" : "#/definitions/LoRaDemodSettings"
},
"LoRaModSettings" : {
"$ref" : "#/definitions/LoRaModSettings"
},
@ -4379,6 +4385,171 @@ margin-bottom: 20px;
}
},
"description" : "LimeSDR"
};
defs.LoRaDemodReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "current de-chirped total channel power (dB)"
},
"noisePowerDB" : {
"type" : "number",
"format" : "float",
"description" : "current de-chirped noise argmax power (dB)"
},
"signalPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "last message de-chirped signal argmax power (dB)"
},
"snrPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "last message de-chirped signal to noise ratio power (dB)"
},
"channelSampleRate" : {
"type" : "integer"
},
"syncWord" : {
"type" : "integer",
"description" : "2 bytes sync word (0..65535)"
},
"hasCRC" : {
"type" : "integer",
"description" : "boolean 1 if payload CRC is present else 0 (LoRa)"
},
"nbParityBits" : {
"type" : "integer",
"description" : "Hamming FEC parity bits (LoRa)"
},
"packetLength" : {
"type" : "integer",
"description" : "Packet length in number of bytes (LoRa)"
},
"nbSymbols" : {
"type" : "integer",
"description" : "Number of symbols in the payload with header and CRC (LoRa)"
},
"nbCodewords" : {
"type" : "integer",
"description" : "Number of codewords in the payload with header and CRC (LoRa)"
},
"headerParityStatus" : {
"type" : "integer",
"description" : "Header FEC parity status:\n * 0 - Undefined\n * 1 - Uncorrectable error\n * 2 - Corrected error\n * 3 - OK\n"
},
"headerCRCStatus" : {
"type" : "integer",
"description" : "header CRC check status. Boolean 1 if OK else 0"
},
"payloadParityStatus" : {
"type" : "integer",
"description" : "Payload FEC parity status:\n * 0 - Undefined\n * 1 - Uncorrectable error\n * 2 - Corrected error\n * 3 - OK\n"
},
"payloadCRCStatus" : {
"type" : "integer",
"description" : "payload CRC check status. Boolean 1 if OK else 0"
},
"messageTimestamp" : {
"type" : "string",
"description" : "timestamp of the last decoded message"
},
"messageString" : {
"type" : "string",
"description" : "string representation of the last decoded message"
},
"messageBytes" : {
"type" : "array",
"description" : "bytes of the last decoded message as an array of hex string represented bytes (00..FF)",
"items" : {
"type" : "string"
}
}
},
"description" : "LoRaDemod"
};
defs.LoRaDemodSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"bandwidthIndex" : {
"type" : "integer",
"description" : "standard bandwidths index:\n * 0 - 2604 Hz (333333 / 128)\n * 1 - 3125 Hz (400000 / 128)\n * 2 - 3906 Hz (500000 / 128)\n * 3 - 5208 Hz (333333 / 64)\n * 4 - 6250 Hz (400000 / 64)\n * 5 - 7813 Hz (500000 / 64)\n * 6 - 10417 Hz (333333 / 32)\n * 7 - 12500 Hz (400000 / 32)\n * 8 - 15625 Hz (500000 / 32)\n * 9 - 20833 Hz (333333 / 16)\n * 10 - 25000 Hz (400000 / 16)\n * 11 - 31250 Hz (500000 / 16)\n * 12 - 41667 Hz (333333 / 8)\n * 13 - 50000 Hz (400000 / 8)\n * 14 - 62500 Hz (500000 / 8)\n * 15 - 83333 Hz (333333 / 4)\n * 16 - 100000 Hz (400000 / 4)\n * 17 - 125000 Hz (500000 / 4)\n * 18 - 166667 Hz (333333 / 2)\n * 19 - 200000 Hz (400000 / 2)\n * 20 - 250000 Hz (500000 / 2)\n * 21 - 333333 Hz (333333 / 1)\n * 22 - 400000 Hz (400000 / 1)\n * 23 - 500000 Hz (500000 / 1)\n"
},
"spreadFactor" : {
"type" : "integer"
},
"deBits" : {
"type" : "integer",
"description" : "Low data rate optmize (DE) bits i.e. nb of FFT bins per effective symbol"
},
"codingScheme" : {
"type" : "integer",
"description" : "message encoding scheme (LoRaModSettings::CodingScheme):\n * 0 - LoRa\n * 1 - Plain ASCII (7 bit)\n * 2 - Teletype (5 bit Baudot) a.k.a TTY\n"
},
"decodeActive" : {
"type" : "integer",
"description" : "boolean 1 to activate 0 to de-activate decoder"
},
"eomSquelchTenths" : {
"type" : "integer",
"description" : "argmax squared magnitude is compared between current multiplied by this factor and maximum during decoding. This value is divided by 10"
},
"nbSymbolsMax" : {
"type" : "integer",
"description" : "expected maximum number of symbols in a payload"
},
"preambleChirps" : {
"type" : "integer",
"description" : "Number of expected preamble chirps"
},
"nbParityBits" : {
"type" : "integer",
"description" : "Hamming FEC parity bits (LoRa)"
},
"packetLength" : {
"type" : "integer",
"description" : "expected packet length in number of bytes (LoRa)"
},
"hasCRC" : {
"type" : "integer",
"description" : "Payload has CRC (LoRa)"
},
"hasHeader" : {
"type" : "integer",
"description" : "Header present before actual payload (LoRa)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"reverseAPIDeviceIndex" : {
"type" : "integer"
},
"reverseAPIChannelIndex" : {
"type" : "integer"
}
},
"description" : "LoRaDemod"
};
defs.LoRaModReport = {
"properties" : {
@ -4415,7 +4586,8 @@ margin-bottom: 20px;
"format" : "int64"
},
"bandwidthIndex" : {
"type" : "integer"
"type" : "integer",
"description" : "standard bandwidths index:\n * 0 - 2604 Hz (333333 / 128)\n * 1 - 3125 Hz (400000 / 128)\n * 2 - 3906 Hz (500000 / 128)\n * 3 - 5208 Hz (333333 / 64)\n * 4 - 6250 Hz (400000 / 64)\n * 5 - 7813 Hz (500000 / 64)\n * 6 - 10417 Hz (333333 / 32)\n * 7 - 12500 Hz (400000 / 32)\n * 8 - 15625 Hz (500000 / 32)\n * 9 - 20833 Hz (333333 / 16)\n * 10 - 25000 Hz (400000 / 16)\n * 11 - 31250 Hz (500000 / 16)\n * 12 - 41667 Hz (333333 / 8)\n * 13 - 50000 Hz (400000 / 8)\n * 14 - 62500 Hz (500000 / 8)\n * 15 - 83333 Hz (333333 / 4)\n * 16 - 100000 Hz (400000 / 4)\n * 17 - 125000 Hz (500000 / 4)\n * 18 - 166667 Hz (333333 / 2)\n * 19 - 200000 Hz (400000 / 2)\n * 20 - 250000 Hz (500000 / 2)\n * 21 - 333333 Hz (333333 / 1)\n * 22 - 400000 Hz (400000 / 1)\n * 23 - 500000 Hz (500000 / 1)\n"
},
"spreadFactor" : {
"type" : "integer"
@ -4474,7 +4646,7 @@ margin-bottom: 20px;
},
"messageType" : {
"type" : "integer",
"description" : "type of message to send (LoRaModSettings::MessageType):\n * 0 - No message i.e no output. Use this as a transition to resend the same message.\n * 1 - Beacon. Sends message specified in beaconMessage\n * 2 - CQ call. Sends message specified in cqMessage\n * 3 - Reply to CQ call. Sends message specified in replyMessage\n * 4 - Report to callee. Sends message specified in reportMessage\n * 5 - Report to caller. Sends message specified in replyReportMessage\n * 6 - RRR to callee. Sends message specified in rrrMessage\n * 7 - 73 to caller. Sends message specified in message73\n * 8 - Random message with callsigns. Sends message specified in qsoTextMessage\n * 9 - Plain text. Sends message specified in textMessage\n * 10 - Binary payload. Sends bytes specified in bytesMessage\n"
"description" : "type of message to send (LoRaModSettings::MessageType):\n * 0 - No message i.e no output. Use this as a transition to resend the same message.\n * 1 - Beacon. Sends message specified in beaconMessage\n * 2 - CQ call. Sends message specified in cqMessage\n * 3 - Reply to CQ call. Sends message specified in replyMessage\n * 4 - Report to callee. Sends message specified in reportMessage\n * 5 - Report to caller. Sends message specified in replyReportMessage\n * 6 - RRR to callee. Sends message specified in rrrMessage\n * 7 - 73 to caller. Sends message specified in message73\n * 8 - Random message with callsigns. Sends message specified in qsoTextMessage\n * 9 - Plain text. Sends message specified in textMessage\n * 10 - Binary payload. Sends bytes specified in bytesMessage\n"
},
"beaconMessage" : {
"type" : "string",
@ -32430,7 +32602,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-02-22T07:44:51.167+01:00
Generated 2020-02-23T10:05:51.852+01:00
</div>
</div>
</div>

View File

@ -45,6 +45,8 @@ ChannelSettings:
$ref: "/doc/swagger/include/FreqTracker.yaml#/FreqTrackerSettings"
InterferometerSettings:
$ref: "/doc/swagger/include/Interferometer.yaml#/InterferometerSettings"
LoRaDemodSettings:
$ref: "/doc/swagger/include/LoRaDemod.yaml#/LoRaDemodSettings"
LoRaModSettings:
$ref: "/doc/swagger/include/LoRaMod.yaml#/LoRaModSettings"
NFMDemodSettings:

View File

@ -0,0 +1,161 @@
LoRaDemodSettings:
description: LoRaDemod
properties:
inputFrequencyOffset:
type: integer
format: int64
bandwidthIndex:
type: integer
description: >
standard bandwidths index:
* 0 - 2604 Hz (333333 / 128)
* 1 - 3125 Hz (400000 / 128)
* 2 - 3906 Hz (500000 / 128)
* 3 - 5208 Hz (333333 / 64)
* 4 - 6250 Hz (400000 / 64)
* 5 - 7813 Hz (500000 / 64)
* 6 - 10417 Hz (333333 / 32)
* 7 - 12500 Hz (400000 / 32)
* 8 - 15625 Hz (500000 / 32)
* 9 - 20833 Hz (333333 / 16)
* 10 - 25000 Hz (400000 / 16)
* 11 - 31250 Hz (500000 / 16)
* 12 - 41667 Hz (333333 / 8)
* 13 - 50000 Hz (400000 / 8)
* 14 - 62500 Hz (500000 / 8)
* 15 - 83333 Hz (333333 / 4)
* 16 - 100000 Hz (400000 / 4)
* 17 - 125000 Hz (500000 / 4)
* 18 - 166667 Hz (333333 / 2)
* 19 - 200000 Hz (400000 / 2)
* 20 - 250000 Hz (500000 / 2)
* 21 - 333333 Hz (333333 / 1)
* 22 - 400000 Hz (400000 / 1)
* 23 - 500000 Hz (500000 / 1)
spreadFactor:
type: integer
deBits:
description: Low data rate optmize (DE) bits i.e. nb of FFT bins per effective symbol
type: integer
codingScheme:
type: integer
description: >
message encoding scheme (LoRaModSettings::CodingScheme):
* 0 - LoRa
* 1 - Plain ASCII (7 bit)
* 2 - Teletype (5 bit Baudot) a.k.a TTY
decodeActive:
description: boolean 1 to activate 0 to de-activate decoder
type: integer
eomSquelchTenths:
description: argmax squared magnitude is compared between current multiplied by this factor and maximum during decoding. This value is divided by 10
type: integer
nbSymbolsMax:
description: expected maximum number of symbols in a payload
type: integer
preambleChirps:
description: Number of expected preamble chirps
type: integer
nbParityBits:
description: Hamming FEC parity bits (LoRa)
type: integer
packetLength:
description: expected packet length in number of bytes (LoRa)
type: integer
hasCRC:
description: Payload has CRC (LoRa)
type: integer
hasHeader:
description: Header present before actual payload (LoRa)
type: integer
rgbColor:
type: integer
title:
type: string
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
useReverseAPI:
description: Synchronize with reverse API (1 for yes, 0 for no)
type: integer
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer
reverseAPIChannelIndex:
type: integer
LoRaDemodReport:
description: LoRaDemod
properties:
channelPowerDB:
description: current de-chirped total channel power (dB)
type: number
format: float
noisePowerDB:
description: current de-chirped noise argmax power (dB)
type: number
format: float
signalPowerDB:
description: last message de-chirped signal argmax power (dB)
type: number
format: float
snrPowerDB:
description: last message de-chirped signal to noise ratio power (dB)
type: number
format: float
channelSampleRate:
type: integer
syncWord:
description: 2 bytes sync word (0..65535)
type: integer
hasCRC:
description: boolean 1 if payload CRC is present else 0 (LoRa)
type: integer
nbParityBits:
description: Hamming FEC parity bits (LoRa)
type: integer
packetLength:
description: Packet length in number of bytes (LoRa)
type: integer
nbSymbols:
description: Number of symbols in the payload with header and CRC (LoRa)
type: integer
nbCodewords:
description: Number of codewords in the payload with header and CRC (LoRa)
type: integer
headerParityStatus:
type: integer
description: >
Header FEC parity status:
* 0 - Undefined
* 1 - Uncorrectable error
* 2 - Corrected error
* 3 - OK
headerCRCStatus:
description: header CRC check status. Boolean 1 if OK else 0
type: integer
payloadParityStatus:
type: integer
description: >
Payload FEC parity status:
* 0 - Undefined
* 1 - Uncorrectable error
* 2 - Corrected error
* 3 - OK
payloadCRCStatus:
description: payload CRC check status. Boolean 1 if OK else 0
type: integer
messageTimestamp:
description: timestamp of the last decoded message
type: string
messageString:
description: string representation of the last decoded message
type: string
messageBytes:
description: bytes of the last decoded message as an array of hex string represented bytes (00..FF)
type: array
items:
type: string

View File

@ -6,6 +6,32 @@ LoRaModSettings:
format: int64
bandwidthIndex:
type: integer
description: >
standard bandwidths index:
* 0 - 2604 Hz (333333 / 128)
* 1 - 3125 Hz (400000 / 128)
* 2 - 3906 Hz (500000 / 128)
* 3 - 5208 Hz (333333 / 64)
* 4 - 6250 Hz (400000 / 64)
* 5 - 7813 Hz (500000 / 64)
* 6 - 10417 Hz (333333 / 32)
* 7 - 12500 Hz (400000 / 32)
* 8 - 15625 Hz (500000 / 32)
* 9 - 20833 Hz (333333 / 16)
* 10 - 25000 Hz (400000 / 16)
* 11 - 31250 Hz (500000 / 16)
* 12 - 41667 Hz (333333 / 8)
* 13 - 50000 Hz (400000 / 8)
* 14 - 62500 Hz (500000 / 8)
* 15 - 83333 Hz (333333 / 4)
* 16 - 100000 Hz (400000 / 4)
* 17 - 125000 Hz (500000 / 4)
* 18 - 166667 Hz (333333 / 2)
* 19 - 200000 Hz (400000 / 2)
* 20 - 250000 Hz (500000 / 2)
* 21 - 333333 Hz (333333 / 1)
* 22 - 400000 Hz (400000 / 1)
* 23 - 500000 Hz (500000 / 1)
spreadFactor:
type: integer
deBits:
@ -55,16 +81,16 @@ LoRaModSettings:
type: integer
description: >
type of message to send (LoRaModSettings::MessageType):
* 0 - No message i.e no output. Use this as a transition to resend the same message.
* 1 - Beacon. Sends message specified in beaconMessage
* 2 - CQ call. Sends message specified in cqMessage
* 3 - Reply to CQ call. Sends message specified in replyMessage
* 4 - Report to callee. Sends message specified in reportMessage
* 5 - Report to caller. Sends message specified in replyReportMessage
* 6 - RRR to callee. Sends message specified in rrrMessage
* 7 - 73 to caller. Sends message specified in message73
* 8 - Random message with callsigns. Sends message specified in qsoTextMessage
* 9 - Plain text. Sends message specified in textMessage
* 0 - No message i.e no output. Use this as a transition to resend the same message.
* 1 - Beacon. Sends message specified in beaconMessage
* 2 - CQ call. Sends message specified in cqMessage
* 3 - Reply to CQ call. Sends message specified in replyMessage
* 4 - Report to callee. Sends message specified in reportMessage
* 5 - Report to caller. Sends message specified in replyReportMessage
* 6 - RRR to callee. Sends message specified in rrrMessage
* 7 - 73 to caller. Sends message specified in message73
* 8 - Random message with callsigns. Sends message specified in qsoTextMessage
* 9 - Plain text. Sends message specified in textMessage
* 10 - Binary payload. Sends bytes specified in bytesMessage
beaconMessage:
description: text message to be sent (repeatedly) as a beaconMessage
@ -94,10 +120,10 @@ LoRaModSettings:
description: freeform text message
type: string
bytesMessage:
description: message to send as an array of hex string represented bytes (00..FF)
type: array
items:
type: string
description: message to send as an array of hex string represented bytes (00..FF)
messageRepeat:
description: number of repetitions of the same message (0 for infinite)
type: integer

View File

@ -2272,6 +2272,8 @@ definitions:
$ref: "/doc/swagger/include/FreeDVMod.yaml#/FreeDVModReport"
FreqTrackerReport:
$ref: "/doc/swagger/include/FreqTracker.yaml#/FreqTrackerReport"
LoRaDemodReport:
$ref: "/doc/swagger/include/LoRaDemod.yaml#/LoRaDemodReport"
LoRaModReport:
$ref: "/doc/swagger/include/LoRaMod.yaml#/LoRaModReport"
NFMDemodReport:

View File

@ -72,6 +72,7 @@ const QMap<QString, QString> WebAPIRequestMapper::m_channelURIToSettingsKey = {
{"sdrangel.demod.localsink", "LocalSinkSettings"},
{"sdrangel.channel.localsink", "LocalSinkSettings"}, // remap
{"sdrangel.channel.localsource", "LocalSourceSettings"},
{"sdrangel.channel.lorademod", "LoRaDemodSettings"},
{"sdrangel.channel.modlora", "LoRaModSettings"},
{"sdrangel.demod.remotesink", "RemoteSinkSettings"},
{"sdrangel.channeltx.remotesource", "RemoteSourceSettings"},
@ -2914,6 +2915,11 @@ bool WebAPIRequestMapper::getChannel(
channelSettings->setLocalSourceSettings(new SWGSDRangel::SWGLocalSourceSettings());
channelSettings->getLocalSourceSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "LoRaDemodSettings")
{
channelSettings->setLoRaDemodSettings(new SWGSDRangel::SWGLoRaDemodSettings());
channelSettings->getLoRaDemodSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "LoRaModSettings")
{
channelSettings->setLoRaModSettings(new SWGSDRangel::SWGLoRaModSettings());

View File

@ -45,6 +45,8 @@ ChannelSettings:
$ref: "http://localhost:8081/api/swagger/include/FreqTracker.yaml#/FreqTrackerSettings"
InterferometerSettings:
$ref: "http://localhost:8081/api/swagger/include/Interferometer.yaml#/InterferometerSettings"
LoRaDemodSettings:
$ref: "http://localhost:8081/api/swagger/include/LoRaDemod.yaml#/LoRaDemodSettings"
LoRaModSettings:
$ref: "http://localhost:8081/api/swagger/include/LoRaMod.yaml#/LoRaModSettings"
NFMDemodSettings:

View File

@ -0,0 +1,161 @@
LoRaDemodSettings:
description: LoRaDemod
properties:
inputFrequencyOffset:
type: integer
format: int64
bandwidthIndex:
type: integer
description: >
standard bandwidths index:
* 0 - 2604 Hz (333333 / 128)
* 1 - 3125 Hz (400000 / 128)
* 2 - 3906 Hz (500000 / 128)
* 3 - 5208 Hz (333333 / 64)
* 4 - 6250 Hz (400000 / 64)
* 5 - 7813 Hz (500000 / 64)
* 6 - 10417 Hz (333333 / 32)
* 7 - 12500 Hz (400000 / 32)
* 8 - 15625 Hz (500000 / 32)
* 9 - 20833 Hz (333333 / 16)
* 10 - 25000 Hz (400000 / 16)
* 11 - 31250 Hz (500000 / 16)
* 12 - 41667 Hz (333333 / 8)
* 13 - 50000 Hz (400000 / 8)
* 14 - 62500 Hz (500000 / 8)
* 15 - 83333 Hz (333333 / 4)
* 16 - 100000 Hz (400000 / 4)
* 17 - 125000 Hz (500000 / 4)
* 18 - 166667 Hz (333333 / 2)
* 19 - 200000 Hz (400000 / 2)
* 20 - 250000 Hz (500000 / 2)
* 21 - 333333 Hz (333333 / 1)
* 22 - 400000 Hz (400000 / 1)
* 23 - 500000 Hz (500000 / 1)
spreadFactor:
type: integer
deBits:
description: Low data rate optmize (DE) bits i.e. nb of FFT bins per effective symbol
type: integer
codingScheme:
type: integer
description: >
message encoding scheme (LoRaModSettings::CodingScheme):
* 0 - LoRa
* 1 - Plain ASCII (7 bit)
* 2 - Teletype (5 bit Baudot) a.k.a TTY
decodeActive:
description: boolean 1 to activate 0 to de-activate decoder
type: integer
eomSquelchTenths:
description: argmax squared magnitude is compared between current multiplied by this factor and maximum during decoding. This value is divided by 10
type: integer
nbSymbolsMax:
description: expected maximum number of symbols in a payload
type: integer
preambleChirps:
description: Number of expected preamble chirps
type: integer
nbParityBits:
description: Hamming FEC parity bits (LoRa)
type: integer
packetLength:
description: expected packet length in number of bytes (LoRa)
type: integer
hasCRC:
description: Payload has CRC (LoRa)
type: integer
hasHeader:
description: Header present before actual payload (LoRa)
type: integer
rgbColor:
type: integer
title:
type: string
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer
useReverseAPI:
description: Synchronize with reverse API (1 for yes, 0 for no)
type: integer
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer
reverseAPIChannelIndex:
type: integer
LoRaDemodReport:
description: LoRaDemod
properties:
channelPowerDB:
description: current de-chirped total channel power (dB)
type: number
format: float
noisePowerDB:
description: current de-chirped noise argmax power (dB)
type: number
format: float
signalPowerDB:
description: last message de-chirped signal argmax power (dB)
type: number
format: float
snrPowerDB:
description: last message de-chirped signal to noise ratio power (dB)
type: number
format: float
channelSampleRate:
type: integer
syncWord:
description: 2 bytes sync word (0..65535)
type: integer
hasCRC:
description: boolean 1 if payload CRC is present else 0 (LoRa)
type: integer
nbParityBits:
description: Hamming FEC parity bits (LoRa)
type: integer
packetLength:
description: Packet length in number of bytes (LoRa)
type: integer
nbSymbols:
description: Number of symbols in the payload with header and CRC (LoRa)
type: integer
nbCodewords:
description: Number of codewords in the payload with header and CRC (LoRa)
type: integer
headerParityStatus:
type: integer
description: >
Header FEC parity status:
* 0 - Undefined
* 1 - Uncorrectable error
* 2 - Corrected error
* 3 - OK
headerCRCStatus:
description: header CRC check status. Boolean 1 if OK else 0
type: integer
payloadParityStatus:
type: integer
description: >
Payload FEC parity status:
* 0 - Undefined
* 1 - Uncorrectable error
* 2 - Corrected error
* 3 - OK
payloadCRCStatus:
description: payload CRC check status. Boolean 1 if OK else 0
type: integer
messageTimestamp:
description: timestamp of the last decoded message
type: string
messageString:
description: string representation of the last decoded message
type: string
messageBytes:
description: bytes of the last decoded message as an array of hex string represented bytes (00..FF)
type: array
items:
type: string

View File

@ -6,6 +6,32 @@ LoRaModSettings:
format: int64
bandwidthIndex:
type: integer
description: >
standard bandwidths index:
* 0 - 2604 Hz (333333 / 128)
* 1 - 3125 Hz (400000 / 128)
* 2 - 3906 Hz (500000 / 128)
* 3 - 5208 Hz (333333 / 64)
* 4 - 6250 Hz (400000 / 64)
* 5 - 7813 Hz (500000 / 64)
* 6 - 10417 Hz (333333 / 32)
* 7 - 12500 Hz (400000 / 32)
* 8 - 15625 Hz (500000 / 32)
* 9 - 20833 Hz (333333 / 16)
* 10 - 25000 Hz (400000 / 16)
* 11 - 31250 Hz (500000 / 16)
* 12 - 41667 Hz (333333 / 8)
* 13 - 50000 Hz (400000 / 8)
* 14 - 62500 Hz (500000 / 8)
* 15 - 83333 Hz (333333 / 4)
* 16 - 100000 Hz (400000 / 4)
* 17 - 125000 Hz (500000 / 4)
* 18 - 166667 Hz (333333 / 2)
* 19 - 200000 Hz (400000 / 2)
* 20 - 250000 Hz (500000 / 2)
* 21 - 333333 Hz (333333 / 1)
* 22 - 400000 Hz (400000 / 1)
* 23 - 500000 Hz (500000 / 1)
spreadFactor:
type: integer
deBits:
@ -55,16 +81,16 @@ LoRaModSettings:
type: integer
description: >
type of message to send (LoRaModSettings::MessageType):
* 0 - No message i.e no output. Use this as a transition to resend the same message.
* 1 - Beacon. Sends message specified in beaconMessage
* 2 - CQ call. Sends message specified in cqMessage
* 3 - Reply to CQ call. Sends message specified in replyMessage
* 4 - Report to callee. Sends message specified in reportMessage
* 5 - Report to caller. Sends message specified in replyReportMessage
* 6 - RRR to callee. Sends message specified in rrrMessage
* 7 - 73 to caller. Sends message specified in message73
* 8 - Random message with callsigns. Sends message specified in qsoTextMessage
* 9 - Plain text. Sends message specified in textMessage
* 0 - No message i.e no output. Use this as a transition to resend the same message.
* 1 - Beacon. Sends message specified in beaconMessage
* 2 - CQ call. Sends message specified in cqMessage
* 3 - Reply to CQ call. Sends message specified in replyMessage
* 4 - Report to callee. Sends message specified in reportMessage
* 5 - Report to caller. Sends message specified in replyReportMessage
* 6 - RRR to callee. Sends message specified in rrrMessage
* 7 - 73 to caller. Sends message specified in message73
* 8 - Random message with callsigns. Sends message specified in qsoTextMessage
* 9 - Plain text. Sends message specified in textMessage
* 10 - Binary payload. Sends bytes specified in bytesMessage
beaconMessage:
description: text message to be sent (repeatedly) as a beaconMessage

View File

@ -2272,6 +2272,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/FreeDVMod.yaml#/FreeDVModReport"
FreqTrackerReport:
$ref: "http://localhost:8081/api/swagger/include/FreqTracker.yaml#/FreqTrackerReport"
LoRaDemodReport:
$ref: "http://localhost:8081/api/swagger/include/LoRaDemod.yaml#/LoRaDemodReport"
LoRaModReport:
$ref: "http://localhost:8081/api/swagger/include/LoRaMod.yaml#/LoRaModReport"
NFMDemodReport:

View File

@ -2184,6 +2184,9 @@ margin-bottom: 20px;
"FreqTrackerReport" : {
"$ref" : "#/definitions/FreqTrackerReport"
},
"LoRaDemodReport" : {
"$ref" : "#/definitions/LoRaDemodReport"
},
"LoRaModReport" : {
"$ref" : "#/definitions/LoRaModReport"
},
@ -2279,6 +2282,9 @@ margin-bottom: 20px;
"InterferometerSettings" : {
"$ref" : "#/definitions/InterferometerSettings"
},
"LoRaDemodSettings" : {
"$ref" : "#/definitions/LoRaDemodSettings"
},
"LoRaModSettings" : {
"$ref" : "#/definitions/LoRaModSettings"
},
@ -4379,6 +4385,171 @@ margin-bottom: 20px;
}
},
"description" : "LimeSDR"
};
defs.LoRaDemodReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "current de-chirped total channel power (dB)"
},
"noisePowerDB" : {
"type" : "number",
"format" : "float",
"description" : "current de-chirped noise argmax power (dB)"
},
"signalPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "last message de-chirped signal argmax power (dB)"
},
"snrPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "last message de-chirped signal to noise ratio power (dB)"
},
"channelSampleRate" : {
"type" : "integer"
},
"syncWord" : {
"type" : "integer",
"description" : "2 bytes sync word (0..65535)"
},
"hasCRC" : {
"type" : "integer",
"description" : "boolean 1 if payload CRC is present else 0 (LoRa)"
},
"nbParityBits" : {
"type" : "integer",
"description" : "Hamming FEC parity bits (LoRa)"
},
"packetLength" : {
"type" : "integer",
"description" : "Packet length in number of bytes (LoRa)"
},
"nbSymbols" : {
"type" : "integer",
"description" : "Number of symbols in the payload with header and CRC (LoRa)"
},
"nbCodewords" : {
"type" : "integer",
"description" : "Number of codewords in the payload with header and CRC (LoRa)"
},
"headerParityStatus" : {
"type" : "integer",
"description" : "Header FEC parity status:\n * 0 - Undefined\n * 1 - Uncorrectable error\n * 2 - Corrected error\n * 3 - OK\n"
},
"headerCRCStatus" : {
"type" : "integer",
"description" : "header CRC check status. Boolean 1 if OK else 0"
},
"payloadParityStatus" : {
"type" : "integer",
"description" : "Payload FEC parity status:\n * 0 - Undefined\n * 1 - Uncorrectable error\n * 2 - Corrected error\n * 3 - OK\n"
},
"payloadCRCStatus" : {
"type" : "integer",
"description" : "payload CRC check status. Boolean 1 if OK else 0"
},
"messageTimestamp" : {
"type" : "string",
"description" : "timestamp of the last decoded message"
},
"messageString" : {
"type" : "string",
"description" : "string representation of the last decoded message"
},
"messageBytes" : {
"type" : "array",
"description" : "bytes of the last decoded message as an array of hex string represented bytes (00..FF)",
"items" : {
"type" : "string"
}
}
},
"description" : "LoRaDemod"
};
defs.LoRaDemodSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"bandwidthIndex" : {
"type" : "integer",
"description" : "standard bandwidths index:\n * 0 - 2604 Hz (333333 / 128)\n * 1 - 3125 Hz (400000 / 128)\n * 2 - 3906 Hz (500000 / 128)\n * 3 - 5208 Hz (333333 / 64)\n * 4 - 6250 Hz (400000 / 64)\n * 5 - 7813 Hz (500000 / 64)\n * 6 - 10417 Hz (333333 / 32)\n * 7 - 12500 Hz (400000 / 32)\n * 8 - 15625 Hz (500000 / 32)\n * 9 - 20833 Hz (333333 / 16)\n * 10 - 25000 Hz (400000 / 16)\n * 11 - 31250 Hz (500000 / 16)\n * 12 - 41667 Hz (333333 / 8)\n * 13 - 50000 Hz (400000 / 8)\n * 14 - 62500 Hz (500000 / 8)\n * 15 - 83333 Hz (333333 / 4)\n * 16 - 100000 Hz (400000 / 4)\n * 17 - 125000 Hz (500000 / 4)\n * 18 - 166667 Hz (333333 / 2)\n * 19 - 200000 Hz (400000 / 2)\n * 20 - 250000 Hz (500000 / 2)\n * 21 - 333333 Hz (333333 / 1)\n * 22 - 400000 Hz (400000 / 1)\n * 23 - 500000 Hz (500000 / 1)\n"
},
"spreadFactor" : {
"type" : "integer"
},
"deBits" : {
"type" : "integer",
"description" : "Low data rate optmize (DE) bits i.e. nb of FFT bins per effective symbol"
},
"codingScheme" : {
"type" : "integer",
"description" : "message encoding scheme (LoRaModSettings::CodingScheme):\n * 0 - LoRa\n * 1 - Plain ASCII (7 bit)\n * 2 - Teletype (5 bit Baudot) a.k.a TTY\n"
},
"decodeActive" : {
"type" : "integer",
"description" : "boolean 1 to activate 0 to de-activate decoder"
},
"eomSquelchTenths" : {
"type" : "integer",
"description" : "argmax squared magnitude is compared between current multiplied by this factor and maximum during decoding. This value is divided by 10"
},
"nbSymbolsMax" : {
"type" : "integer",
"description" : "expected maximum number of symbols in a payload"
},
"preambleChirps" : {
"type" : "integer",
"description" : "Number of expected preamble chirps"
},
"nbParityBits" : {
"type" : "integer",
"description" : "Hamming FEC parity bits (LoRa)"
},
"packetLength" : {
"type" : "integer",
"description" : "expected packet length in number of bytes (LoRa)"
},
"hasCRC" : {
"type" : "integer",
"description" : "Payload has CRC (LoRa)"
},
"hasHeader" : {
"type" : "integer",
"description" : "Header present before actual payload (LoRa)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"streamIndex" : {
"type" : "integer",
"description" : "MIMO channel. Not relevant when connected to SI (single Rx)."
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"reverseAPIDeviceIndex" : {
"type" : "integer"
},
"reverseAPIChannelIndex" : {
"type" : "integer"
}
},
"description" : "LoRaDemod"
};
defs.LoRaModReport = {
"properties" : {
@ -4415,7 +4586,8 @@ margin-bottom: 20px;
"format" : "int64"
},
"bandwidthIndex" : {
"type" : "integer"
"type" : "integer",
"description" : "standard bandwidths index:\n * 0 - 2604 Hz (333333 / 128)\n * 1 - 3125 Hz (400000 / 128)\n * 2 - 3906 Hz (500000 / 128)\n * 3 - 5208 Hz (333333 / 64)\n * 4 - 6250 Hz (400000 / 64)\n * 5 - 7813 Hz (500000 / 64)\n * 6 - 10417 Hz (333333 / 32)\n * 7 - 12500 Hz (400000 / 32)\n * 8 - 15625 Hz (500000 / 32)\n * 9 - 20833 Hz (333333 / 16)\n * 10 - 25000 Hz (400000 / 16)\n * 11 - 31250 Hz (500000 / 16)\n * 12 - 41667 Hz (333333 / 8)\n * 13 - 50000 Hz (400000 / 8)\n * 14 - 62500 Hz (500000 / 8)\n * 15 - 83333 Hz (333333 / 4)\n * 16 - 100000 Hz (400000 / 4)\n * 17 - 125000 Hz (500000 / 4)\n * 18 - 166667 Hz (333333 / 2)\n * 19 - 200000 Hz (400000 / 2)\n * 20 - 250000 Hz (500000 / 2)\n * 21 - 333333 Hz (333333 / 1)\n * 22 - 400000 Hz (400000 / 1)\n * 23 - 500000 Hz (500000 / 1)\n"
},
"spreadFactor" : {
"type" : "integer"
@ -4474,7 +4646,7 @@ margin-bottom: 20px;
},
"messageType" : {
"type" : "integer",
"description" : "type of message to send (LoRaModSettings::MessageType):\n * 0 - No message i.e no output. Use this as a transition to resend the same message.\n * 1 - Beacon. Sends message specified in beaconMessage\n * 2 - CQ call. Sends message specified in cqMessage\n * 3 - Reply to CQ call. Sends message specified in replyMessage\n * 4 - Report to callee. Sends message specified in reportMessage\n * 5 - Report to caller. Sends message specified in replyReportMessage\n * 6 - RRR to callee. Sends message specified in rrrMessage\n * 7 - 73 to caller. Sends message specified in message73\n * 8 - Random message with callsigns. Sends message specified in qsoTextMessage\n * 9 - Plain text. Sends message specified in textMessage\n * 10 - Binary payload. Sends bytes specified in bytesMessage\n"
"description" : "type of message to send (LoRaModSettings::MessageType):\n * 0 - No message i.e no output. Use this as a transition to resend the same message.\n * 1 - Beacon. Sends message specified in beaconMessage\n * 2 - CQ call. Sends message specified in cqMessage\n * 3 - Reply to CQ call. Sends message specified in replyMessage\n * 4 - Report to callee. Sends message specified in reportMessage\n * 5 - Report to caller. Sends message specified in replyReportMessage\n * 6 - RRR to callee. Sends message specified in rrrMessage\n * 7 - 73 to caller. Sends message specified in message73\n * 8 - Random message with callsigns. Sends message specified in qsoTextMessage\n * 9 - Plain text. Sends message specified in textMessage\n * 10 - Binary payload. Sends bytes specified in bytesMessage\n"
},
"beaconMessage" : {
"type" : "string",
@ -32430,7 +32602,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-02-22T07:44:51.167+01:00
Generated 2020-02-23T10:05:51.852+01:00
</div>
</div>
</div>

View File

@ -50,6 +50,8 @@ SWGChannelReport::SWGChannelReport() {
m_free_dv_mod_report_isSet = false;
freq_tracker_report = nullptr;
m_freq_tracker_report_isSet = false;
lo_ra_demod_report = nullptr;
m_lo_ra_demod_report_isSet = false;
lo_ra_mod_report = nullptr;
m_lo_ra_mod_report_isSet = false;
nfm_demod_report = nullptr;
@ -100,6 +102,8 @@ SWGChannelReport::init() {
m_free_dv_mod_report_isSet = false;
freq_tracker_report = new SWGFreqTrackerReport();
m_freq_tracker_report_isSet = false;
lo_ra_demod_report = new SWGLoRaDemodReport();
m_lo_ra_demod_report_isSet = false;
lo_ra_mod_report = new SWGLoRaModReport();
m_lo_ra_mod_report_isSet = false;
nfm_demod_report = new SWGNFMDemodReport();
@ -155,6 +159,9 @@ SWGChannelReport::cleanup() {
if(freq_tracker_report != nullptr) {
delete freq_tracker_report;
}
if(lo_ra_demod_report != nullptr) {
delete lo_ra_demod_report;
}
if(lo_ra_mod_report != nullptr) {
delete lo_ra_mod_report;
}
@ -220,6 +227,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&freq_tracker_report, pJson["FreqTrackerReport"], "SWGFreqTrackerReport", "SWGFreqTrackerReport");
::SWGSDRangel::setValue(&lo_ra_demod_report, pJson["LoRaDemodReport"], "SWGLoRaDemodReport", "SWGLoRaDemodReport");
::SWGSDRangel::setValue(&lo_ra_mod_report, pJson["LoRaModReport"], "SWGLoRaModReport", "SWGLoRaModReport");
::SWGSDRangel::setValue(&nfm_demod_report, pJson["NFMDemodReport"], "SWGNFMDemodReport", "SWGNFMDemodReport");
@ -289,6 +298,9 @@ SWGChannelReport::asJsonObject() {
if((freq_tracker_report != nullptr) && (freq_tracker_report->isSet())){
toJsonValue(QString("FreqTrackerReport"), freq_tracker_report, obj, QString("SWGFreqTrackerReport"));
}
if((lo_ra_demod_report != nullptr) && (lo_ra_demod_report->isSet())){
toJsonValue(QString("LoRaDemodReport"), lo_ra_demod_report, obj, QString("SWGLoRaDemodReport"));
}
if((lo_ra_mod_report != nullptr) && (lo_ra_mod_report->isSet())){
toJsonValue(QString("LoRaModReport"), lo_ra_mod_report, obj, QString("SWGLoRaModReport"));
}
@ -433,6 +445,16 @@ SWGChannelReport::setFreqTrackerReport(SWGFreqTrackerReport* freq_tracker_report
this->m_freq_tracker_report_isSet = true;
}
SWGLoRaDemodReport*
SWGChannelReport::getLoRaDemodReport() {
return lo_ra_demod_report;
}
void
SWGChannelReport::setLoRaDemodReport(SWGLoRaDemodReport* lo_ra_demod_report) {
this->lo_ra_demod_report = lo_ra_demod_report;
this->m_lo_ra_demod_report_isSet = true;
}
SWGLoRaModReport*
SWGChannelReport::getLoRaModReport() {
return lo_ra_mod_report;
@ -571,6 +593,9 @@ SWGChannelReport::isSet(){
if(freq_tracker_report && freq_tracker_report->isSet()){
isObjectUpdated = true; break;
}
if(lo_ra_demod_report && lo_ra_demod_report->isSet()){
isObjectUpdated = true; break;
}
if(lo_ra_mod_report && lo_ra_mod_report->isSet()){
isObjectUpdated = true; break;
}

View File

@ -31,6 +31,7 @@
#include "SWGFreeDVDemodReport.h"
#include "SWGFreeDVModReport.h"
#include "SWGFreqTrackerReport.h"
#include "SWGLoRaDemodReport.h"
#include "SWGLoRaModReport.h"
#include "SWGNFMDemodReport.h"
#include "SWGNFMModReport.h"
@ -94,6 +95,9 @@ public:
SWGFreqTrackerReport* getFreqTrackerReport();
void setFreqTrackerReport(SWGFreqTrackerReport* freq_tracker_report);
SWGLoRaDemodReport* getLoRaDemodReport();
void setLoRaDemodReport(SWGLoRaDemodReport* lo_ra_demod_report);
SWGLoRaModReport* getLoRaModReport();
void setLoRaModReport(SWGLoRaModReport* lo_ra_mod_report);
@ -161,6 +165,9 @@ private:
SWGFreqTrackerReport* freq_tracker_report;
bool m_freq_tracker_report_isSet;
SWGLoRaDemodReport* lo_ra_demod_report;
bool m_lo_ra_demod_report_isSet;
SWGLoRaModReport* lo_ra_mod_report;
bool m_lo_ra_mod_report_isSet;

View File

@ -64,6 +64,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_freq_tracker_settings_isSet = false;
interferometer_settings = nullptr;
m_interferometer_settings_isSet = false;
lo_ra_demod_settings = nullptr;
m_lo_ra_demod_settings_isSet = false;
lo_ra_mod_settings = nullptr;
m_lo_ra_mod_settings_isSet = false;
nfm_demod_settings = nullptr;
@ -134,6 +136,8 @@ SWGChannelSettings::init() {
m_freq_tracker_settings_isSet = false;
interferometer_settings = new SWGInterferometerSettings();
m_interferometer_settings_isSet = false;
lo_ra_demod_settings = new SWGLoRaDemodSettings();
m_lo_ra_demod_settings_isSet = false;
lo_ra_mod_settings = new SWGLoRaModSettings();
m_lo_ra_mod_settings_isSet = false;
nfm_demod_settings = new SWGNFMDemodSettings();
@ -212,6 +216,9 @@ SWGChannelSettings::cleanup() {
if(interferometer_settings != nullptr) {
delete interferometer_settings;
}
if(lo_ra_demod_settings != nullptr) {
delete lo_ra_demod_settings;
}
if(lo_ra_mod_settings != nullptr) {
delete lo_ra_mod_settings;
}
@ -300,6 +307,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&interferometer_settings, pJson["InterferometerSettings"], "SWGInterferometerSettings", "SWGInterferometerSettings");
::SWGSDRangel::setValue(&lo_ra_demod_settings, pJson["LoRaDemodSettings"], "SWGLoRaDemodSettings", "SWGLoRaDemodSettings");
::SWGSDRangel::setValue(&lo_ra_mod_settings, pJson["LoRaModSettings"], "SWGLoRaModSettings", "SWGLoRaModSettings");
::SWGSDRangel::setValue(&nfm_demod_settings, pJson["NFMDemodSettings"], "SWGNFMDemodSettings", "SWGNFMDemodSettings");
@ -396,6 +405,9 @@ SWGChannelSettings::asJsonObject() {
if((interferometer_settings != nullptr) && (interferometer_settings->isSet())){
toJsonValue(QString("InterferometerSettings"), interferometer_settings, obj, QString("SWGInterferometerSettings"));
}
if((lo_ra_demod_settings != nullptr) && (lo_ra_demod_settings->isSet())){
toJsonValue(QString("LoRaDemodSettings"), lo_ra_demod_settings, obj, QString("SWGLoRaDemodSettings"));
}
if((lo_ra_mod_settings != nullptr) && (lo_ra_mod_settings->isSet())){
toJsonValue(QString("LoRaModSettings"), lo_ra_mod_settings, obj, QString("SWGLoRaModSettings"));
}
@ -619,6 +631,16 @@ SWGChannelSettings::setInterferometerSettings(SWGInterferometerSettings* interfe
this->m_interferometer_settings_isSet = true;
}
SWGLoRaDemodSettings*
SWGChannelSettings::getLoRaDemodSettings() {
return lo_ra_demod_settings;
}
void
SWGChannelSettings::setLoRaDemodSettings(SWGLoRaDemodSettings* lo_ra_demod_settings) {
this->lo_ra_demod_settings = lo_ra_demod_settings;
this->m_lo_ra_demod_settings_isSet = true;
}
SWGLoRaModSettings*
SWGChannelSettings::getLoRaModSettings() {
return lo_ra_mod_settings;
@ -808,6 +830,9 @@ SWGChannelSettings::isSet(){
if(interferometer_settings && interferometer_settings->isSet()){
isObjectUpdated = true; break;
}
if(lo_ra_demod_settings && lo_ra_demod_settings->isSet()){
isObjectUpdated = true; break;
}
if(lo_ra_mod_settings && lo_ra_mod_settings->isSet()){
isObjectUpdated = true; break;
}

View File

@ -36,6 +36,7 @@
#include "SWGFreeDVModSettings.h"
#include "SWGFreqTrackerSettings.h"
#include "SWGInterferometerSettings.h"
#include "SWGLoRaDemodSettings.h"
#include "SWGLoRaModSettings.h"
#include "SWGLocalSinkSettings.h"
#include "SWGLocalSourceSettings.h"
@ -123,6 +124,9 @@ public:
SWGInterferometerSettings* getInterferometerSettings();
void setInterferometerSettings(SWGInterferometerSettings* interferometer_settings);
SWGLoRaDemodSettings* getLoRaDemodSettings();
void setLoRaDemodSettings(SWGLoRaDemodSettings* lo_ra_demod_settings);
SWGLoRaModSettings* getLoRaModSettings();
void setLoRaModSettings(SWGLoRaModSettings* lo_ra_mod_settings);
@ -220,6 +224,9 @@ private:
SWGInterferometerSettings* interferometer_settings;
bool m_interferometer_settings_isSet;
SWGLoRaDemodSettings* lo_ra_demod_settings;
bool m_lo_ra_demod_settings_isSet;
SWGLoRaModSettings* lo_ra_mod_settings;
bool m_lo_ra_mod_settings_isSet;

View File

@ -0,0 +1,509 @@
/**
* 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 5.1.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 "SWGLoRaDemodReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGLoRaDemodReport::SWGLoRaDemodReport(QString* json) {
init();
this->fromJson(*json);
}
SWGLoRaDemodReport::SWGLoRaDemodReport() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
noise_power_db = 0.0f;
m_noise_power_db_isSet = false;
signal_power_db = 0.0f;
m_signal_power_db_isSet = false;
snr_power_db = 0.0f;
m_snr_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
sync_word = 0;
m_sync_word_isSet = false;
has_crc = 0;
m_has_crc_isSet = false;
nb_parity_bits = 0;
m_nb_parity_bits_isSet = false;
packet_length = 0;
m_packet_length_isSet = false;
nb_symbols = 0;
m_nb_symbols_isSet = false;
nb_codewords = 0;
m_nb_codewords_isSet = false;
header_parity_status = 0;
m_header_parity_status_isSet = false;
header_crc_status = 0;
m_header_crc_status_isSet = false;
payload_parity_status = 0;
m_payload_parity_status_isSet = false;
payload_crc_status = 0;
m_payload_crc_status_isSet = false;
message_timestamp = nullptr;
m_message_timestamp_isSet = false;
message_string = nullptr;
m_message_string_isSet = false;
message_bytes = nullptr;
m_message_bytes_isSet = false;
}
SWGLoRaDemodReport::~SWGLoRaDemodReport() {
this->cleanup();
}
void
SWGLoRaDemodReport::init() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
noise_power_db = 0.0f;
m_noise_power_db_isSet = false;
signal_power_db = 0.0f;
m_signal_power_db_isSet = false;
snr_power_db = 0.0f;
m_snr_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
sync_word = 0;
m_sync_word_isSet = false;
has_crc = 0;
m_has_crc_isSet = false;
nb_parity_bits = 0;
m_nb_parity_bits_isSet = false;
packet_length = 0;
m_packet_length_isSet = false;
nb_symbols = 0;
m_nb_symbols_isSet = false;
nb_codewords = 0;
m_nb_codewords_isSet = false;
header_parity_status = 0;
m_header_parity_status_isSet = false;
header_crc_status = 0;
m_header_crc_status_isSet = false;
payload_parity_status = 0;
m_payload_parity_status_isSet = false;
payload_crc_status = 0;
m_payload_crc_status_isSet = false;
message_timestamp = new QString("");
m_message_timestamp_isSet = false;
message_string = new QString("");
m_message_string_isSet = false;
message_bytes = new QList<QString*>();
m_message_bytes_isSet = false;
}
void
SWGLoRaDemodReport::cleanup() {
if(message_timestamp != nullptr) {
delete message_timestamp;
}
if(message_string != nullptr) {
delete message_string;
}
if(message_bytes != nullptr) {
auto arr = message_bytes;
for(auto o: *arr) {
delete o;
}
delete message_bytes;
}
}
SWGLoRaDemodReport*
SWGLoRaDemodReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGLoRaDemodReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
::SWGSDRangel::setValue(&noise_power_db, pJson["noisePowerDB"], "float", "");
::SWGSDRangel::setValue(&signal_power_db, pJson["signalPowerDB"], "float", "");
::SWGSDRangel::setValue(&snr_power_db, pJson["snrPowerDB"], "float", "");
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&sync_word, pJson["syncWord"], "qint32", "");
::SWGSDRangel::setValue(&has_crc, pJson["hasCRC"], "qint32", "");
::SWGSDRangel::setValue(&nb_parity_bits, pJson["nbParityBits"], "qint32", "");
::SWGSDRangel::setValue(&packet_length, pJson["packetLength"], "qint32", "");
::SWGSDRangel::setValue(&nb_symbols, pJson["nbSymbols"], "qint32", "");
::SWGSDRangel::setValue(&nb_codewords, pJson["nbCodewords"], "qint32", "");
::SWGSDRangel::setValue(&header_parity_status, pJson["headerParityStatus"], "qint32", "");
::SWGSDRangel::setValue(&header_crc_status, pJson["headerCRCStatus"], "qint32", "");
::SWGSDRangel::setValue(&payload_parity_status, pJson["payloadParityStatus"], "qint32", "");
::SWGSDRangel::setValue(&payload_crc_status, pJson["payloadCRCStatus"], "qint32", "");
::SWGSDRangel::setValue(&message_timestamp, pJson["messageTimestamp"], "QString", "QString");
::SWGSDRangel::setValue(&message_string, pJson["messageString"], "QString", "QString");
::SWGSDRangel::setValue(&message_bytes, pJson["messageBytes"], "QList", "QString");
}
QString
SWGLoRaDemodReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGLoRaDemodReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_channel_power_db_isSet){
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
}
if(m_noise_power_db_isSet){
obj->insert("noisePowerDB", QJsonValue(noise_power_db));
}
if(m_signal_power_db_isSet){
obj->insert("signalPowerDB", QJsonValue(signal_power_db));
}
if(m_snr_power_db_isSet){
obj->insert("snrPowerDB", QJsonValue(snr_power_db));
}
if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
}
if(m_sync_word_isSet){
obj->insert("syncWord", QJsonValue(sync_word));
}
if(m_has_crc_isSet){
obj->insert("hasCRC", QJsonValue(has_crc));
}
if(m_nb_parity_bits_isSet){
obj->insert("nbParityBits", QJsonValue(nb_parity_bits));
}
if(m_packet_length_isSet){
obj->insert("packetLength", QJsonValue(packet_length));
}
if(m_nb_symbols_isSet){
obj->insert("nbSymbols", QJsonValue(nb_symbols));
}
if(m_nb_codewords_isSet){
obj->insert("nbCodewords", QJsonValue(nb_codewords));
}
if(m_header_parity_status_isSet){
obj->insert("headerParityStatus", QJsonValue(header_parity_status));
}
if(m_header_crc_status_isSet){
obj->insert("headerCRCStatus", QJsonValue(header_crc_status));
}
if(m_payload_parity_status_isSet){
obj->insert("payloadParityStatus", QJsonValue(payload_parity_status));
}
if(m_payload_crc_status_isSet){
obj->insert("payloadCRCStatus", QJsonValue(payload_crc_status));
}
if(message_timestamp != nullptr && *message_timestamp != QString("")){
toJsonValue(QString("messageTimestamp"), message_timestamp, obj, QString("QString"));
}
if(message_string != nullptr && *message_string != QString("")){
toJsonValue(QString("messageString"), message_string, obj, QString("QString"));
}
if(message_bytes && message_bytes->size() > 0){
toJsonArray((QList<void*>*)message_bytes, obj, "messageBytes", "QString");
}
return obj;
}
float
SWGLoRaDemodReport::getChannelPowerDb() {
return channel_power_db;
}
void
SWGLoRaDemodReport::setChannelPowerDb(float channel_power_db) {
this->channel_power_db = channel_power_db;
this->m_channel_power_db_isSet = true;
}
float
SWGLoRaDemodReport::getNoisePowerDb() {
return noise_power_db;
}
void
SWGLoRaDemodReport::setNoisePowerDb(float noise_power_db) {
this->noise_power_db = noise_power_db;
this->m_noise_power_db_isSet = true;
}
float
SWGLoRaDemodReport::getSignalPowerDb() {
return signal_power_db;
}
void
SWGLoRaDemodReport::setSignalPowerDb(float signal_power_db) {
this->signal_power_db = signal_power_db;
this->m_signal_power_db_isSet = true;
}
float
SWGLoRaDemodReport::getSnrPowerDb() {
return snr_power_db;
}
void
SWGLoRaDemodReport::setSnrPowerDb(float snr_power_db) {
this->snr_power_db = snr_power_db;
this->m_snr_power_db_isSet = true;
}
qint32
SWGLoRaDemodReport::getChannelSampleRate() {
return channel_sample_rate;
}
void
SWGLoRaDemodReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->channel_sample_rate = channel_sample_rate;
this->m_channel_sample_rate_isSet = true;
}
qint32
SWGLoRaDemodReport::getSyncWord() {
return sync_word;
}
void
SWGLoRaDemodReport::setSyncWord(qint32 sync_word) {
this->sync_word = sync_word;
this->m_sync_word_isSet = true;
}
qint32
SWGLoRaDemodReport::getHasCrc() {
return has_crc;
}
void
SWGLoRaDemodReport::setHasCrc(qint32 has_crc) {
this->has_crc = has_crc;
this->m_has_crc_isSet = true;
}
qint32
SWGLoRaDemodReport::getNbParityBits() {
return nb_parity_bits;
}
void
SWGLoRaDemodReport::setNbParityBits(qint32 nb_parity_bits) {
this->nb_parity_bits = nb_parity_bits;
this->m_nb_parity_bits_isSet = true;
}
qint32
SWGLoRaDemodReport::getPacketLength() {
return packet_length;
}
void
SWGLoRaDemodReport::setPacketLength(qint32 packet_length) {
this->packet_length = packet_length;
this->m_packet_length_isSet = true;
}
qint32
SWGLoRaDemodReport::getNbSymbols() {
return nb_symbols;
}
void
SWGLoRaDemodReport::setNbSymbols(qint32 nb_symbols) {
this->nb_symbols = nb_symbols;
this->m_nb_symbols_isSet = true;
}
qint32
SWGLoRaDemodReport::getNbCodewords() {
return nb_codewords;
}
void
SWGLoRaDemodReport::setNbCodewords(qint32 nb_codewords) {
this->nb_codewords = nb_codewords;
this->m_nb_codewords_isSet = true;
}
qint32
SWGLoRaDemodReport::getHeaderParityStatus() {
return header_parity_status;
}
void
SWGLoRaDemodReport::setHeaderParityStatus(qint32 header_parity_status) {
this->header_parity_status = header_parity_status;
this->m_header_parity_status_isSet = true;
}
qint32
SWGLoRaDemodReport::getHeaderCrcStatus() {
return header_crc_status;
}
void
SWGLoRaDemodReport::setHeaderCrcStatus(qint32 header_crc_status) {
this->header_crc_status = header_crc_status;
this->m_header_crc_status_isSet = true;
}
qint32
SWGLoRaDemodReport::getPayloadParityStatus() {
return payload_parity_status;
}
void
SWGLoRaDemodReport::setPayloadParityStatus(qint32 payload_parity_status) {
this->payload_parity_status = payload_parity_status;
this->m_payload_parity_status_isSet = true;
}
qint32
SWGLoRaDemodReport::getPayloadCrcStatus() {
return payload_crc_status;
}
void
SWGLoRaDemodReport::setPayloadCrcStatus(qint32 payload_crc_status) {
this->payload_crc_status = payload_crc_status;
this->m_payload_crc_status_isSet = true;
}
QString*
SWGLoRaDemodReport::getMessageTimestamp() {
return message_timestamp;
}
void
SWGLoRaDemodReport::setMessageTimestamp(QString* message_timestamp) {
this->message_timestamp = message_timestamp;
this->m_message_timestamp_isSet = true;
}
QString*
SWGLoRaDemodReport::getMessageString() {
return message_string;
}
void
SWGLoRaDemodReport::setMessageString(QString* message_string) {
this->message_string = message_string;
this->m_message_string_isSet = true;
}
QList<QString*>*
SWGLoRaDemodReport::getMessageBytes() {
return message_bytes;
}
void
SWGLoRaDemodReport::setMessageBytes(QList<QString*>* message_bytes) {
this->message_bytes = message_bytes;
this->m_message_bytes_isSet = true;
}
bool
SWGLoRaDemodReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_channel_power_db_isSet){
isObjectUpdated = true; break;
}
if(m_noise_power_db_isSet){
isObjectUpdated = true; break;
}
if(m_signal_power_db_isSet){
isObjectUpdated = true; break;
}
if(m_snr_power_db_isSet){
isObjectUpdated = true; break;
}
if(m_channel_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(m_sync_word_isSet){
isObjectUpdated = true; break;
}
if(m_has_crc_isSet){
isObjectUpdated = true; break;
}
if(m_nb_parity_bits_isSet){
isObjectUpdated = true; break;
}
if(m_packet_length_isSet){
isObjectUpdated = true; break;
}
if(m_nb_symbols_isSet){
isObjectUpdated = true; break;
}
if(m_nb_codewords_isSet){
isObjectUpdated = true; break;
}
if(m_header_parity_status_isSet){
isObjectUpdated = true; break;
}
if(m_header_crc_status_isSet){
isObjectUpdated = true; break;
}
if(m_payload_parity_status_isSet){
isObjectUpdated = true; break;
}
if(m_payload_crc_status_isSet){
isObjectUpdated = true; break;
}
if(message_timestamp && *message_timestamp != QString("")){
isObjectUpdated = true; break;
}
if(message_string && *message_string != QString("")){
isObjectUpdated = true; break;
}
if(message_bytes && (message_bytes->size() > 0)){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,162 @@
/**
* 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 5.1.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.
*/
/*
* SWGLoRaDemodReport.h
*
* LoRaDemod
*/
#ifndef SWGLoRaDemodReport_H_
#define SWGLoRaDemodReport_H_
#include <QJsonObject>
#include <QList>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGLoRaDemodReport: public SWGObject {
public:
SWGLoRaDemodReport();
SWGLoRaDemodReport(QString* json);
virtual ~SWGLoRaDemodReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGLoRaDemodReport* fromJson(QString &jsonString) override;
float getChannelPowerDb();
void setChannelPowerDb(float channel_power_db);
float getNoisePowerDb();
void setNoisePowerDb(float noise_power_db);
float getSignalPowerDb();
void setSignalPowerDb(float signal_power_db);
float getSnrPowerDb();
void setSnrPowerDb(float snr_power_db);
qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate);
qint32 getSyncWord();
void setSyncWord(qint32 sync_word);
qint32 getHasCrc();
void setHasCrc(qint32 has_crc);
qint32 getNbParityBits();
void setNbParityBits(qint32 nb_parity_bits);
qint32 getPacketLength();
void setPacketLength(qint32 packet_length);
qint32 getNbSymbols();
void setNbSymbols(qint32 nb_symbols);
qint32 getNbCodewords();
void setNbCodewords(qint32 nb_codewords);
qint32 getHeaderParityStatus();
void setHeaderParityStatus(qint32 header_parity_status);
qint32 getHeaderCrcStatus();
void setHeaderCrcStatus(qint32 header_crc_status);
qint32 getPayloadParityStatus();
void setPayloadParityStatus(qint32 payload_parity_status);
qint32 getPayloadCrcStatus();
void setPayloadCrcStatus(qint32 payload_crc_status);
QString* getMessageTimestamp();
void setMessageTimestamp(QString* message_timestamp);
QString* getMessageString();
void setMessageString(QString* message_string);
QList<QString*>* getMessageBytes();
void setMessageBytes(QList<QString*>* message_bytes);
virtual bool isSet() override;
private:
float channel_power_db;
bool m_channel_power_db_isSet;
float noise_power_db;
bool m_noise_power_db_isSet;
float signal_power_db;
bool m_signal_power_db_isSet;
float snr_power_db;
bool m_snr_power_db_isSet;
qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet;
qint32 sync_word;
bool m_sync_word_isSet;
qint32 has_crc;
bool m_has_crc_isSet;
qint32 nb_parity_bits;
bool m_nb_parity_bits_isSet;
qint32 packet_length;
bool m_packet_length_isSet;
qint32 nb_symbols;
bool m_nb_symbols_isSet;
qint32 nb_codewords;
bool m_nb_codewords_isSet;
qint32 header_parity_status;
bool m_header_parity_status_isSet;
qint32 header_crc_status;
bool m_header_crc_status_isSet;
qint32 payload_parity_status;
bool m_payload_parity_status_isSet;
qint32 payload_crc_status;
bool m_payload_crc_status_isSet;
QString* message_timestamp;
bool m_message_timestamp_isSet;
QString* message_string;
bool m_message_string_isSet;
QList<QString*>* message_bytes;
bool m_message_bytes_isSet;
};
}
#endif /* SWGLoRaDemodReport_H_ */

View File

@ -0,0 +1,572 @@
/**
* 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 5.1.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 "SWGLoRaDemodSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGLoRaDemodSettings::SWGLoRaDemodSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGLoRaDemodSettings::SWGLoRaDemodSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
bandwidth_index = 0;
m_bandwidth_index_isSet = false;
spread_factor = 0;
m_spread_factor_isSet = false;
de_bits = 0;
m_de_bits_isSet = false;
coding_scheme = 0;
m_coding_scheme_isSet = false;
decode_active = 0;
m_decode_active_isSet = false;
eom_squelch_tenths = 0;
m_eom_squelch_tenths_isSet = false;
nb_symbols_max = 0;
m_nb_symbols_max_isSet = false;
preamble_chirps = 0;
m_preamble_chirps_isSet = false;
nb_parity_bits = 0;
m_nb_parity_bits_isSet = false;
packet_length = 0;
m_packet_length_isSet = false;
has_crc = 0;
m_has_crc_isSet = false;
has_header = 0;
m_has_header_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
m_title_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = nullptr;
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
}
SWGLoRaDemodSettings::~SWGLoRaDemodSettings() {
this->cleanup();
}
void
SWGLoRaDemodSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
bandwidth_index = 0;
m_bandwidth_index_isSet = false;
spread_factor = 0;
m_spread_factor_isSet = false;
de_bits = 0;
m_de_bits_isSet = false;
coding_scheme = 0;
m_coding_scheme_isSet = false;
decode_active = 0;
m_decode_active_isSet = false;
eom_squelch_tenths = 0;
m_eom_squelch_tenths_isSet = false;
nb_symbols_max = 0;
m_nb_symbols_max_isSet = false;
preamble_chirps = 0;
m_preamble_chirps_isSet = false;
nb_parity_bits = 0;
m_nb_parity_bits_isSet = false;
packet_length = 0;
m_packet_length_isSet = false;
has_crc = 0;
m_has_crc_isSet = false;
has_header = 0;
m_has_header_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
m_title_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = new QString("");
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
reverse_api_device_index = 0;
m_reverse_api_device_index_isSet = false;
reverse_api_channel_index = 0;
m_reverse_api_channel_index_isSet = false;
}
void
SWGLoRaDemodSettings::cleanup() {
if(title != nullptr) {
delete title;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
}
SWGLoRaDemodSettings*
SWGLoRaDemodSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGLoRaDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&bandwidth_index, pJson["bandwidthIndex"], "qint32", "");
::SWGSDRangel::setValue(&spread_factor, pJson["spreadFactor"], "qint32", "");
::SWGSDRangel::setValue(&de_bits, pJson["deBits"], "qint32", "");
::SWGSDRangel::setValue(&coding_scheme, pJson["codingScheme"], "qint32", "");
::SWGSDRangel::setValue(&decode_active, pJson["decodeActive"], "qint32", "");
::SWGSDRangel::setValue(&eom_squelch_tenths, pJson["eomSquelchTenths"], "qint32", "");
::SWGSDRangel::setValue(&nb_symbols_max, pJson["nbSymbolsMax"], "qint32", "");
::SWGSDRangel::setValue(&preamble_chirps, pJson["preambleChirps"], "qint32", "");
::SWGSDRangel::setValue(&nb_parity_bits, pJson["nbParityBits"], "qint32", "");
::SWGSDRangel::setValue(&packet_length, pJson["packetLength"], "qint32", "");
::SWGSDRangel::setValue(&has_crc, pJson["hasCRC"], "qint32", "");
::SWGSDRangel::setValue(&has_header, pJson["hasHeader"], "qint32", "");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
}
QString
SWGLoRaDemodSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGLoRaDemodSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(m_bandwidth_index_isSet){
obj->insert("bandwidthIndex", QJsonValue(bandwidth_index));
}
if(m_spread_factor_isSet){
obj->insert("spreadFactor", QJsonValue(spread_factor));
}
if(m_de_bits_isSet){
obj->insert("deBits", QJsonValue(de_bits));
}
if(m_coding_scheme_isSet){
obj->insert("codingScheme", QJsonValue(coding_scheme));
}
if(m_decode_active_isSet){
obj->insert("decodeActive", QJsonValue(decode_active));
}
if(m_eom_squelch_tenths_isSet){
obj->insert("eomSquelchTenths", QJsonValue(eom_squelch_tenths));
}
if(m_nb_symbols_max_isSet){
obj->insert("nbSymbolsMax", QJsonValue(nb_symbols_max));
}
if(m_preamble_chirps_isSet){
obj->insert("preambleChirps", QJsonValue(preamble_chirps));
}
if(m_nb_parity_bits_isSet){
obj->insert("nbParityBits", QJsonValue(nb_parity_bits));
}
if(m_packet_length_isSet){
obj->insert("packetLength", QJsonValue(packet_length));
}
if(m_has_crc_isSet){
obj->insert("hasCRC", QJsonValue(has_crc));
}
if(m_has_header_isSet){
obj->insert("hasHeader", QJsonValue(has_header));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
if(m_use_reverse_api_isSet){
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
}
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
}
if(m_reverse_api_port_isSet){
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
}
if(m_reverse_api_device_index_isSet){
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
}
if(m_reverse_api_channel_index_isSet){
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
}
return obj;
}
qint64
SWGLoRaDemodSettings::getInputFrequencyOffset() {
return input_frequency_offset;
}
void
SWGLoRaDemodSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true;
}
qint32
SWGLoRaDemodSettings::getBandwidthIndex() {
return bandwidth_index;
}
void
SWGLoRaDemodSettings::setBandwidthIndex(qint32 bandwidth_index) {
this->bandwidth_index = bandwidth_index;
this->m_bandwidth_index_isSet = true;
}
qint32
SWGLoRaDemodSettings::getSpreadFactor() {
return spread_factor;
}
void
SWGLoRaDemodSettings::setSpreadFactor(qint32 spread_factor) {
this->spread_factor = spread_factor;
this->m_spread_factor_isSet = true;
}
qint32
SWGLoRaDemodSettings::getDeBits() {
return de_bits;
}
void
SWGLoRaDemodSettings::setDeBits(qint32 de_bits) {
this->de_bits = de_bits;
this->m_de_bits_isSet = true;
}
qint32
SWGLoRaDemodSettings::getCodingScheme() {
return coding_scheme;
}
void
SWGLoRaDemodSettings::setCodingScheme(qint32 coding_scheme) {
this->coding_scheme = coding_scheme;
this->m_coding_scheme_isSet = true;
}
qint32
SWGLoRaDemodSettings::getDecodeActive() {
return decode_active;
}
void
SWGLoRaDemodSettings::setDecodeActive(qint32 decode_active) {
this->decode_active = decode_active;
this->m_decode_active_isSet = true;
}
qint32
SWGLoRaDemodSettings::getEomSquelchTenths() {
return eom_squelch_tenths;
}
void
SWGLoRaDemodSettings::setEomSquelchTenths(qint32 eom_squelch_tenths) {
this->eom_squelch_tenths = eom_squelch_tenths;
this->m_eom_squelch_tenths_isSet = true;
}
qint32
SWGLoRaDemodSettings::getNbSymbolsMax() {
return nb_symbols_max;
}
void
SWGLoRaDemodSettings::setNbSymbolsMax(qint32 nb_symbols_max) {
this->nb_symbols_max = nb_symbols_max;
this->m_nb_symbols_max_isSet = true;
}
qint32
SWGLoRaDemodSettings::getPreambleChirps() {
return preamble_chirps;
}
void
SWGLoRaDemodSettings::setPreambleChirps(qint32 preamble_chirps) {
this->preamble_chirps = preamble_chirps;
this->m_preamble_chirps_isSet = true;
}
qint32
SWGLoRaDemodSettings::getNbParityBits() {
return nb_parity_bits;
}
void
SWGLoRaDemodSettings::setNbParityBits(qint32 nb_parity_bits) {
this->nb_parity_bits = nb_parity_bits;
this->m_nb_parity_bits_isSet = true;
}
qint32
SWGLoRaDemodSettings::getPacketLength() {
return packet_length;
}
void
SWGLoRaDemodSettings::setPacketLength(qint32 packet_length) {
this->packet_length = packet_length;
this->m_packet_length_isSet = true;
}
qint32
SWGLoRaDemodSettings::getHasCrc() {
return has_crc;
}
void
SWGLoRaDemodSettings::setHasCrc(qint32 has_crc) {
this->has_crc = has_crc;
this->m_has_crc_isSet = true;
}
qint32
SWGLoRaDemodSettings::getHasHeader() {
return has_header;
}
void
SWGLoRaDemodSettings::setHasHeader(qint32 has_header) {
this->has_header = has_header;
this->m_has_header_isSet = true;
}
qint32
SWGLoRaDemodSettings::getRgbColor() {
return rgb_color;
}
void
SWGLoRaDemodSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
QString*
SWGLoRaDemodSettings::getTitle() {
return title;
}
void
SWGLoRaDemodSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
qint32
SWGLoRaDemodSettings::getStreamIndex() {
return stream_index;
}
void
SWGLoRaDemodSettings::setStreamIndex(qint32 stream_index) {
this->stream_index = stream_index;
this->m_stream_index_isSet = true;
}
qint32
SWGLoRaDemodSettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGLoRaDemodSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGLoRaDemodSettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGLoRaDemodSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGLoRaDemodSettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGLoRaDemodSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGLoRaDemodSettings::getReverseApiDeviceIndex() {
return reverse_api_device_index;
}
void
SWGLoRaDemodSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
this->reverse_api_device_index = reverse_api_device_index;
this->m_reverse_api_device_index_isSet = true;
}
qint32
SWGLoRaDemodSettings::getReverseApiChannelIndex() {
return reverse_api_channel_index;
}
void
SWGLoRaDemodSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
this->reverse_api_channel_index = reverse_api_channel_index;
this->m_reverse_api_channel_index_isSet = true;
}
bool
SWGLoRaDemodSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_input_frequency_offset_isSet){
isObjectUpdated = true; break;
}
if(m_bandwidth_index_isSet){
isObjectUpdated = true; break;
}
if(m_spread_factor_isSet){
isObjectUpdated = true; break;
}
if(m_de_bits_isSet){
isObjectUpdated = true; break;
}
if(m_coding_scheme_isSet){
isObjectUpdated = true; break;
}
if(m_decode_active_isSet){
isObjectUpdated = true; break;
}
if(m_eom_squelch_tenths_isSet){
isObjectUpdated = true; break;
}
if(m_nb_symbols_max_isSet){
isObjectUpdated = true; break;
}
if(m_preamble_chirps_isSet){
isObjectUpdated = true; break;
}
if(m_nb_parity_bits_isSet){
isObjectUpdated = true; break;
}
if(m_packet_length_isSet){
isObjectUpdated = true; break;
}
if(m_has_crc_isSet){
isObjectUpdated = true; break;
}
if(m_has_header_isSet){
isObjectUpdated = true; break;
}
if(m_rgb_color_isSet){
isObjectUpdated = true; break;
}
if(title && *title != QString("")){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}
if(m_use_reverse_api_isSet){
isObjectUpdated = true; break;
}
if(reverse_api_address && *reverse_api_address != QString("")){
isObjectUpdated = true; break;
}
if(m_reverse_api_port_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_device_index_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_channel_index_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,179 @@
/**
* 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 5.1.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.
*/
/*
* SWGLoRaDemodSettings.h
*
* LoRaDemod
*/
#ifndef SWGLoRaDemodSettings_H_
#define SWGLoRaDemodSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGLoRaDemodSettings: public SWGObject {
public:
SWGLoRaDemodSettings();
SWGLoRaDemodSettings(QString* json);
virtual ~SWGLoRaDemodSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGLoRaDemodSettings* fromJson(QString &jsonString) override;
qint64 getInputFrequencyOffset();
void setInputFrequencyOffset(qint64 input_frequency_offset);
qint32 getBandwidthIndex();
void setBandwidthIndex(qint32 bandwidth_index);
qint32 getSpreadFactor();
void setSpreadFactor(qint32 spread_factor);
qint32 getDeBits();
void setDeBits(qint32 de_bits);
qint32 getCodingScheme();
void setCodingScheme(qint32 coding_scheme);
qint32 getDecodeActive();
void setDecodeActive(qint32 decode_active);
qint32 getEomSquelchTenths();
void setEomSquelchTenths(qint32 eom_squelch_tenths);
qint32 getNbSymbolsMax();
void setNbSymbolsMax(qint32 nb_symbols_max);
qint32 getPreambleChirps();
void setPreambleChirps(qint32 preamble_chirps);
qint32 getNbParityBits();
void setNbParityBits(qint32 nb_parity_bits);
qint32 getPacketLength();
void setPacketLength(qint32 packet_length);
qint32 getHasCrc();
void setHasCrc(qint32 has_crc);
qint32 getHasHeader();
void setHasHeader(qint32 has_header);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
QString* getTitle();
void setTitle(QString* title);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
qint32 getUseReverseApi();
void setUseReverseApi(qint32 use_reverse_api);
QString* getReverseApiAddress();
void setReverseApiAddress(QString* reverse_api_address);
qint32 getReverseApiPort();
void setReverseApiPort(qint32 reverse_api_port);
qint32 getReverseApiDeviceIndex();
void setReverseApiDeviceIndex(qint32 reverse_api_device_index);
qint32 getReverseApiChannelIndex();
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
virtual bool isSet() override;
private:
qint64 input_frequency_offset;
bool m_input_frequency_offset_isSet;
qint32 bandwidth_index;
bool m_bandwidth_index_isSet;
qint32 spread_factor;
bool m_spread_factor_isSet;
qint32 de_bits;
bool m_de_bits_isSet;
qint32 coding_scheme;
bool m_coding_scheme_isSet;
qint32 decode_active;
bool m_decode_active_isSet;
qint32 eom_squelch_tenths;
bool m_eom_squelch_tenths_isSet;
qint32 nb_symbols_max;
bool m_nb_symbols_max_isSet;
qint32 preamble_chirps;
bool m_preamble_chirps_isSet;
qint32 nb_parity_bits;
bool m_nb_parity_bits_isSet;
qint32 packet_length;
bool m_packet_length_isSet;
qint32 has_crc;
bool m_has_crc_isSet;
qint32 has_header;
bool m_has_header_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;
QString* title;
bool m_title_isSet;
qint32 stream_index;
bool m_stream_index_isSet;
qint32 use_reverse_api;
bool m_use_reverse_api_isSet;
QString* reverse_api_address;
bool m_reverse_api_address_isSet;
qint32 reverse_api_port;
bool m_reverse_api_port_isSet;
qint32 reverse_api_device_index;
bool m_reverse_api_device_index_isSet;
qint32 reverse_api_channel_index;
bool m_reverse_api_channel_index_isSet;
};
}
#endif /* SWGLoRaDemodSettings_H_ */

View File

@ -101,6 +101,8 @@
#include "SWGLimeSdrInputSettings.h"
#include "SWGLimeSdrOutputReport.h"
#include "SWGLimeSdrOutputSettings.h"
#include "SWGLoRaDemodReport.h"
#include "SWGLoRaDemodSettings.h"
#include "SWGLoRaModReport.h"
#include "SWGLoRaModSettings.h"
#include "SWGLocalInputReport.h"
@ -441,6 +443,12 @@ namespace SWGSDRangel {
if(QString("SWGLimeSdrOutputSettings").compare(type) == 0) {
return new SWGLimeSdrOutputSettings();
}
if(QString("SWGLoRaDemodReport").compare(type) == 0) {
return new SWGLoRaDemodReport();
}
if(QString("SWGLoRaDemodSettings").compare(type) == 0) {
return new SWGLoRaDemodSettings();
}
if(QString("SWGLoRaModReport").compare(type) == 0) {
return new SWGLoRaModReport();
}