1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-12-02 04:43:18 -05:00

LoRa: various updates and fixes

This commit is contained in:
f4exb 2020-02-25 23:41:07 +01:00
parent 3b4c651a49
commit 463b1bb603
19 changed files with 388 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

View File

@ -85,6 +85,10 @@ LoRaDemod::~LoRaDemod()
delete m_thread;
}
uint32_t LoRaDemod::getNumberOfDeviceStreams() const
{
return m_deviceAPI->getNbSourceStreams();
}
void LoRaDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool pO)
{
@ -175,6 +179,19 @@ bool LoRaDemod::handleMessage(const Message& cmd)
msgToGUI->setPayloadCRCStatus(m_lastMsgPayloadCRC);
getMessageQueueToGUI()->push(msgToGUI);
}
if (m_settings.m_autoNbSymbolsMax)
{
LoRaDemodSettings settings = m_settings;
settings.m_nbSymbolsMax = m_lastMsgNbSymbols;
applySettings(settings);
if (getMessageQueueToGUI()) // forward to GUI if any
{
MsgConfigureLoRaDemod *msgToGUI = MsgConfigureLoRaDemod::create(settings, false);
getMessageQueueToGUI()->push(msgToGUI);
}
}
}
else
{
@ -258,6 +275,7 @@ void LoRaDemod::applySettings(const LoRaDemodSettings& settings, bool force)
<< " m_hasCRC: " << settings.m_hasCRC
<< " m_nbParityBits: " << settings.m_nbParityBits
<< " m_packetLength: " << settings.m_packetLength
<< " m_autoNbSymbolsMax: " << settings.m_autoNbSymbolsMax
<< " m_sendViaUDP: " << settings.m_sendViaUDP
<< " m_udpAddress: " << settings.m_udpAddress
<< " m_udpPort: " << settings.m_udpPort
@ -336,6 +354,9 @@ void LoRaDemod::applySettings(const LoRaDemodSettings& settings, bool force)
if ((settings.m_sendViaUDP != m_settings.m_sendViaUDP) || force) {
reverseAPIKeys.append("sendViaUDP");
}
if ((settings.m_autoNbSymbolsMax != m_settings.m_autoNbSymbolsMax) || force) {
reverseAPIKeys.append("autoNbSymbolsMax");
}
if ((settings.m_udpAddress != m_settings.m_udpAddress) || force)
{
@ -443,6 +464,9 @@ void LoRaDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("nbSymbolsMax")) {
settings.m_nbSymbolsMax = response.getLoRaDemodSettings()->getNbSymbolsMax();
}
if (channelSettingsKeys.contains("autoNbSymbolsMax")) {
settings.m_autoNbSymbolsMax = response.getLoRaDemodSettings()->getAutoNbSymbolsMax() != 0;
}
if (channelSettingsKeys.contains("preambleChirps")) {
settings.m_preambleChirps = response.getLoRaDemodSettings()->getPreambleChirps();
}
@ -458,6 +482,17 @@ void LoRaDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("hasHeader")) {
settings.m_hasHeader = response.getLoRaDemodSettings()->getHasHeader() != 0;
}
if (channelSettingsKeys.contains("sendViaUDP")) {
settings.m_sendViaUDP = response.getLoRaDemodSettings()->getSendViaUdp() != 0;
}
if (channelSettingsKeys.contains("udpAddress")) {
settings.m_udpAddress = *response.getLoRaDemodSettings()->getUdpAddress();
}
if (channelSettingsKeys.contains("udpPort"))
{
uint16_t port = response.getLoRaDemodSettings()->getUdpPort();
settings.m_udpPort = port < 1024 ? 1024 : port > 65535 ? 65535 : port;
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getLoRaDemodSettings()->getRgbColor();
}
@ -505,11 +540,20 @@ void LoRaDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getLoRaDemodSettings()->setDecodeActive(settings.m_decodeActive ? 1 : 0);
response.getLoRaDemodSettings()->setEomSquelchTenths(settings.m_eomSquelchTenths);
response.getLoRaDemodSettings()->setNbSymbolsMax(settings.m_nbSymbolsMax);
response.getLoRaDemodSettings()->setAutoNbSymbolsMax(settings.m_autoNbSymbolsMax ? 1 : 0);
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()->setSendViaUdp(settings.m_sendViaUDP ? 1 : 0);
if (response.getLoRaDemodSettings()->getUdpAddress()) {
*response.getLoRaDemodSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getLoRaDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getLoRaDemodSettings()->setUdpPort(settings.m_udpPort);
response.getLoRaDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getLoRaDemodSettings()->getTitle()) {
@ -590,11 +634,14 @@ void LoRaDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, c
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("eomSquelchTenths") || force) {
swgLoRaDemodSettings->setEomSquelchTenths(settings.m_eomSquelchTenths);
}
if (channelSettingsKeys.contains("decodeActive") || force) {
swgLoRaDemodSettings->setNbSymbolsMax(settings.m_nbSymbolsMax ? 1 : 0);
if (channelSettingsKeys.contains("nbSymbolsMax") || force) {
swgLoRaDemodSettings->setNbSymbolsMax(settings.m_nbSymbolsMax);
}
if (channelSettingsKeys.contains("autoNbSymbolsMax") || force) {
swgLoRaDemodSettings->setAutoNbSymbolsMax(settings.m_nbSymbolsMax ? 1 : 0);
}
if (channelSettingsKeys.contains("preambleChirps") || force) {
swgLoRaDemodSettings->setPreambleChirps(settings.m_preambleChirps);
@ -608,6 +655,15 @@ void LoRaDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, c
if (channelSettingsKeys.contains("hasHeader") || force) {
swgLoRaDemodSettings->setHasHeader(settings.m_hasHeader ? 1 : 0);
}
if (channelSettingsKeys.contains("sendViaUDP") || force) {
swgLoRaDemodSettings->setSendViaUdp(settings.m_sendViaUDP ? 1 : 0);
}
if (channelSettingsKeys.contains("udpAddress") || force) {
swgLoRaDemodSettings->setUdpAddress(new QString(settings.m_udpAddress));
}
if (channelSettingsKeys.contains("updPort") || force) {
swgLoRaDemodSettings->setUdpPort(settings.m_udpPort);
}
if (channelSettingsKeys.contains("rgbColor") || force) {
swgLoRaDemodSettings->setRgbColor(settings.m_rgbColor);
}

View File

@ -251,6 +251,8 @@ public:
double getCurrentNoiseLevel() const;
double getTotalPower() const;
uint32_t getNumberOfDeviceStreams() const;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -25,6 +25,8 @@
#include "dsp/dspcommands.h"
#include "gui/glspectrum.h"
#include "gui/glspectrumgui.h"
#include "gui/basicchannelsettingsdialog.h"
#include "gui/devicestreamselectiondialog.h"
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "util/db.h"
@ -126,6 +128,17 @@ bool LoRaDemodGUI::handleMessage(const Message& message)
return true;
}
else if (LoRaDemod::MsgConfigureLoRaDemod::match(message))
{
qDebug("LoRaDemod::handleMessage: NFMDemod::MsgConfigureLoRaDemod");
const LoRaDemod::MsgConfigureLoRaDemod& cfg = (LoRaDemod::MsgConfigureLoRaDemod&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
blockApplySettings(false);
return true;
}
else
{
return false;
@ -243,6 +256,12 @@ void LoRaDemodGUI::on_messageLength_valueChanged(int value)
applySettings();
}
void LoRaDemodGUI::on_messageLengthAuto_stateChanged(int state)
{
m_settings.m_autoNbSymbolsMax = (state == Qt::Checked);
applySettings();
}
void LoRaDemodGUI::on_header_stateChanged(int state)
{
m_settings.m_hasHeader = (state == Qt::Checked);
@ -316,6 +335,51 @@ void LoRaDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
(void) rollDown;
}
void LoRaDemodGUI::onMenuDialogCalled(const QPoint &p)
{
if (m_contextMenuType == ContextMenuChannelSettings)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
dialog.move(p);
dialog.exec();
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
m_settings.m_title = m_channelMarker.getTitle();
m_settings.m_useReverseAPI = dialog.useReverseAPI();
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
setWindowTitle(m_settings.m_title);
setTitleColor(m_settings.m_rgbColor);
applySettings();
}
else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine))
{
DeviceStreamSelectionDialog dialog(this);
dialog.setNumberOfStreams(m_LoRaDemod->getNumberOfDeviceStreams());
dialog.setStreamIndex(m_settings.m_streamIndex);
dialog.move(p);
dialog.exec();
m_settings.m_streamIndex = dialog.getSelectedStreamIndex();
m_channelMarker.clearStreamIndexes();
m_channelMarker.addStreamIndex(m_settings.m_streamIndex);
displayStreamIndex();
applySettings();
}
resetContextMenuType();
}
LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
RollupWidget(parent),
ui(new Ui::LoRaDemodGUI),
@ -329,6 +393,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
m_LoRaDemod = (LoRaDemod*) rxChannel; //new LoRaDemod(m_deviceUISet->m_deviceSourceAPI);
@ -440,11 +505,22 @@ void LoRaDemodGUI::displaySettings()
ui->spectrumGUI->setFFTSize(m_settings.m_spreadFactor);
}
ui->messageLengthAuto->setChecked(m_settings.m_autoNbSymbolsMax);
displaySquelch();
blockApplySettings(false);
}
void LoRaDemodGUI::displayStreamIndex()
{
if (m_deviceUISet->m_deviceMIMOEngine) {
setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex));
} else {
setStreamIndicator("S"); // single channel indicator
}
}
void LoRaDemodGUI::displaySquelch()
{
ui->eomSquelch->setValue(m_settings.m_eomSquelchTenths);

View File

@ -65,6 +65,7 @@ private slots:
void on_clear_clicked(bool checked);
void on_eomSquelch_valueChanged(int value);
void on_messageLength_valueChanged(int value);
void on_messageLengthAuto_stateChanged(int state);
void on_header_stateChanged(int state);
void on_fecParity_valueChanged(int value);
void on_crc_stateChanged(int state);
@ -73,6 +74,7 @@ private slots:
void on_udpAddress_editingFinished();
void on_udpPort_editingFinished();
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void channelMarkerHighlightedByCursor();
void handleInputMessages();
void tick();
@ -105,6 +107,7 @@ private:
void blockApplySettings(bool block);
void applySettings(bool force = false);
void displaySettings();
void displayStreamIndex();
void displaySquelch();
void setBandwidths();
void showLoRaMessage(const Message& message);

View File

@ -476,7 +476,7 @@
</size>
</property>
<property name="toolTip">
<string>De-chirped signal power</string>
<string>De-chirped signal maximum power</string>
</property>
<property name="text">
<string>-50.0</string>
@ -508,7 +508,7 @@
</rect>
</property>
<property name="toolTip">
<string>De-chirped noise power</string>
<string>De-chirped noise maximum power</string>
</property>
<property name="text">
<string>-50.0</string>
@ -1084,7 +1084,7 @@
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="fecParityText_2">
<widget class="QLabel" name="symbolsCodewordsSeparator">
<property name="geometry">
<rect>
<x>328</x>
@ -1197,6 +1197,22 @@
<string>9998</string>
</property>
</widget>
<widget class="QCheckBox" name="messageLengthAuto">
<property name="geometry">
<rect>
<x>360</x>
<y>10</y>
<width>50</width>
<height>16</height>
</rect>
</property>
<property name="toolTip">
<string>Set message length in symbols automatically to provided message length (LoRa only)</string>
</property>
<property name="text">
<string>Auto</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="spectrumContainer" native="true">
<property name="geometry">

View File

@ -41,16 +41,17 @@ struct LoRaDemodSettings
int m_deBits; //!< Low data rate optmize (DE) bits
CodingScheme m_codingScheme;
bool m_decodeActive;
int m_eomSquelchTenths; //!< Squelch factor to trigger end of message (/10)
int m_nbSymbolsMax; //!< Maximum number of symbols in a payload
int m_preambleChirps; //!< Number of expected preamble chirps
int m_nbParityBits; //!< Hamming parity bits (LoRa)
int m_packetLength; //!< Payload packet length in bytes or characters (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
bool m_sendViaUDP; //!< Send decoded message via UDP
QString m_udpAddress; //!< UDP address where to send message
uint16_t m_udpPort; //!< UDP port where to send message
int m_eomSquelchTenths; //!< Squelch factor to trigger end of message (/10)
int m_nbSymbolsMax; //!< Maximum number of symbols in a payload
bool m_autoNbSymbolsMax; //!< Set maximum number of symbols in a payload automatically using last messag value
int m_preambleChirps; //!< Number of expected preamble chirps
int m_nbParityBits; //!< Hamming parity bits (LoRa)
int m_packetLength; //!< Payload packet length in bytes or characters (LoRa)
bool m_hasCRC; //!< Payload has CRC (LoRa)
bool m_hasHeader; //!< Header present before actual payload (LoRa)
bool m_sendViaUDP; //!< Send decoded message via UDP
QString m_udpAddress; //!< UDP address where to send message
uint16_t m_udpPort; //!< UDP port where to send message
uint32_t m_rgbColor;
QString m_title;
int m_streamIndex;

View File

@ -9,6 +9,8 @@ This plugin can be used to demodulate and decode LoRa transmissions.
This plugin has been designed to work in conjunction with the LoRa modulator plugin. However it can receive transmissions from the RN2483 module when the Distance Enhancement is engaged (4 FFT bins per symbol) which happens with spread factors 11 and 12. Il is very difficult in general to get good decodes when only one FFT bin is used by symbol. It has not been tested with Semtech SX127x hardware.
This plugin is designed to experiment with chirp modulation and LoRa technique. It does not replace dedicated hardware for production grade links.
Note: this plugin is available in version 5 only (since 5.2.0).
<h2>Interface</h2>
@ -58,17 +60,17 @@ Thus available bandwidths are:
The LoRa signal is oversampled by two therefore it needs a baseband of at least twice the bandwidth. This drives the maximum value on the slider automatically.
<h3>4: De-chirped noise power</h3>
<h3>4: De-chirped noise maximum power</h3>
This is the maximum power received in one FFT bin (the argmax bin) in dB when no signal is detected. It is averaged over 10 values.
<h3>5. De-chirped signal power</h3>
<h3>5. De-chirped signal maximum power</h3>
This is the maximum power received in one FFT bin (the argmax bin) in dB when a signal is detected. It is averaged over 10 values.
<h3>6: De-chirped signal over noise ratio</h3>
The noise level reference is the one just before the detected signal starts and the signal level the one just before the detected signal stops. To get a significant reading you have to adjust correctly the number of preamble chirps (9) and the End Of Message squelch level (A.3) and/or the message length (A.4) so that signal boundaries are determined correctly.
The noise level reference is the noise maximum power just before the detected signal starts and the signal level the signal maximum power just before the detected signal stops. To get a significant reading you have to adjust correctly the number of preamble chirps (9) and the End Of Message squelch level (A.3) and/or the message length (A.4) so that signal boundaries are determined correctly.
Decode errors are very likely to happen when this value falls below 4 dB.
@ -110,17 +112,21 @@ During paylaod detection the maximum power value in the FFT (at argmax) P<sub>ma
This is the expected number of symbols in a message. When a header is present in the payload it should match the size given in the header (A.11).
<h4>A.5: Sync word</h4>
<h4>A.5: Auto mesasge length</h4>
LoRa mode only. Set message length (A.4) equal to the number of symbols specified in the message just received. When messages are sent repeatedly this helps adjusting in possible message length changes automatically.
<h4>A.6: Sync word</h4>
This is the message 1 byte sync word displayed in hexadecimal.
<h4>A.7: Expect header in message</h4>
LoRa standard only. Use this checkbox to tell if you expect or not a header in the message.
LoRa mode only. Use this checkbox to tell if you expect or not a header in the message.
<h4>A.8: Number of FEC parity bits</h4>
LoRa standard only. This is the number of parity bits in the Hamming code used in the FEC. The standard values are 1 to 4 for H(4,5) to H(4,8) encoding. 0 is a non-standard value to specify no FEC.
LoRa mode only. This is the number of parity bits in the Hamming code used in the FEC. The standard values are 1 to 4 for H(4,5) to H(4,8) encoding. 0 is a non-standard value to specify no FEC.
When a header is expected this control is disabled because the value used is the one found in the header.
@ -249,6 +255,14 @@ Corresponds to (A.15) indicator in the current message
This is a group of 4 bytes displayed as hexadecimal values. The payload is displayed with its possible CRC and without the header.
<h3>12: Send message via UDP</h3>
Select to send the decoded message via UDP.
<h3>13: UDP address and port</h3>
This is the UDP address and port to where the decoded message is sent when (12) is selected.
<h3>B: De-chirped spectrum</h3>
This is the spectrum of the de-chirped signal when a LoRa signal can be decoded.

View File

@ -137,6 +137,15 @@ void LoRaMod::applySettings(const LoRaModSettings& settings, bool force)
<< " m_rfBandwidth: " << settings.m_bandwidthIndex
<< " bandwidth: " << LoRaModSettings::bandwidths[settings.m_bandwidthIndex]
<< " m_channelMute: " << settings.m_channelMute
<< " m_beaconMessage: " << settings.m_beaconMessage
<< " m_cqMessage: " << settings.m_cqMessage
<< " m_replyMessage: " << settings.m_replyMessage
<< " m_reportMessage:" << settings.m_reportMessage
<< " m_replyReportMessage: " << settings.m_replyReportMessage
<< " m_rrrMessage: " << settings.m_rrrMessage
<< " m_73message: " << settings.m_73Message
<< " m_qsoTextMessage: " << settings.m_qsoTextMessage
<< " m_textMessage: " << settings.m_textMessage
<< " m_useReverseAPI: " << settings.m_useReverseAPI
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIAddress: " << settings.m_reverseAPIPort
@ -237,70 +246,70 @@ void LoRaMod::applySettings(const LoRaModSettings& settings, bool force)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_beaconMessage != m_settings.m_beaconMessage) || force))
{
m_encoder.encodeString(m_settings.m_beaconMessage, symbols);
m_encoder.encodeString(settings.m_beaconMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageCQ)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_cqMessage != m_settings.m_cqMessage) || force))
{
m_encoder.encodeString(m_settings.m_cqMessage, symbols);
m_encoder.encodeString(settings.m_cqMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageReply)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_replyMessage != m_settings.m_replyMessage) || force))
{
m_encoder.encodeString(m_settings.m_replyMessage, symbols);
m_encoder.encodeString(settings.m_replyMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageReport)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_reportMessage != m_settings.m_reportMessage) || force))
{
m_encoder.encodeString(m_settings.m_reportMessage, symbols);
m_encoder.encodeString(settings.m_reportMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageReplyReport)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_replyReportMessage != m_settings.m_replyReportMessage) || force))
{
m_encoder.encodeString(m_settings.m_replyReportMessage, symbols);
m_encoder.encodeString(settings.m_replyReportMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageRRR)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_rrrMessage != m_settings.m_rrrMessage) || force))
{
m_encoder.encodeString(m_settings.m_rrrMessage, symbols);
m_encoder.encodeString(settings.m_rrrMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::Message73)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_73Message != m_settings.m_73Message) || force))
{
m_encoder.encodeString(m_settings.m_73Message, symbols);
m_encoder.encodeString(settings.m_73Message, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageQSOText)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_qsoTextMessage != m_settings.m_qsoTextMessage) || force))
{
m_encoder.encodeString(m_settings.m_qsoTextMessage, symbols);
m_encoder.encodeString(settings.m_qsoTextMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageText)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_textMessage != m_settings.m_textMessage) || force))
{
m_encoder.encodeString(m_settings.m_textMessage, symbols);
m_encoder.encodeString(settings.m_textMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}
else if ((settings.m_messageType == LoRaModSettings::MessageBytes)
&& ((settings.m_messageType != m_settings.m_messageType)
|| (settings.m_bytesMessage != m_settings.m_bytesMessage) || force))
{
m_encoder.encodeBytes(m_settings.m_bytesMessage, symbols);
m_encoder.encodeBytes(settings.m_bytesMessage, symbols);
payloadMsg = LoRaModBaseband::MsgConfigureLoRaModPayload::create(symbols);
}

View File

@ -11,6 +11,8 @@ This plugin has been designed to work in conjunction with the LoRa demodulator p
The standard LoRa specification has been extended to support plain ASCII and TTY encoded message using the same chirp based modulation. Distance Enhancement factor values have also been extended to cover the full 0 to 4 range.
This plugin is designed to experiment with chirp modulation and LoRa technique. It does not replace dedicated hardware for production grade links.
Note: this plugin is available in version 5 only (since 5.2.0).
<h2>Interface</h2>

View File

@ -4502,6 +4502,10 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "expected maximum number of symbols in a payload"
},
"autoNbSymbolsMax" : {
"type" : "integer",
"description" : "adjust maximum number of symbols in a payload to the value just received (LoRa)"
},
"preambleChirps" : {
"type" : "integer",
"description" : "Number of expected preamble chirps"
@ -4522,6 +4526,18 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "Header present before actual payload (LoRa)"
},
"sendViaUDP" : {
"type" : "integer",
"description" : "boolean 1 to send decoded message via UDP else 0"
},
"udpAddress" : {
"type" : "string",
"description" : "UDP destination udpAddress"
},
"udpPort" : {
"type" : "integer",
"description" : "UDP destination properties"
},
"rgbColor" : {
"type" : "integer"
},
@ -32602,7 +32618,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-02-23T10:05:51.852+01:00
Generated 2020-02-25T14:33:44.826+01:00
</div>
</div>
</div>

View File

@ -53,6 +53,9 @@ LoRaDemodSettings:
nbSymbolsMax:
description: expected maximum number of symbols in a payload
type: integer
autoNbSymbolsMax:
description: adjust maximum number of symbols in a payload to the value just received (LoRa)
type: integer
preambleChirps:
description: Number of expected preamble chirps
type: integer
@ -68,6 +71,15 @@ LoRaDemodSettings:
hasHeader:
description: Header present before actual payload (LoRa)
type: integer
sendViaUDP:
description: boolean 1 to send decoded message via UDP else 0
type: integer
udpAddress:
description: UDP destination udpAddress
type: string
udpPort:
description: UDP destination properties
type: integer
rgbColor:
type: integer
title:

View File

@ -53,6 +53,9 @@ LoRaDemodSettings:
nbSymbolsMax:
description: expected maximum number of symbols in a payload
type: integer
autoNbSymbolsMax:
description: adjust maximum number of symbols in a payload to the value just received (LoRa)
type: integer
preambleChirps:
description: Number of expected preamble chirps
type: integer
@ -68,6 +71,15 @@ LoRaDemodSettings:
hasHeader:
description: Header present before actual payload (LoRa)
type: integer
sendViaUDP:
description: boolean 1 to send decoded message via UDP else 0
type: integer
udpAddress:
description: UDP destination udpAddress
type: string
udpPort:
description: UDP destination properties
type: integer
rgbColor:
type: integer
title:

View File

@ -4502,6 +4502,10 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "expected maximum number of symbols in a payload"
},
"autoNbSymbolsMax" : {
"type" : "integer",
"description" : "adjust maximum number of symbols in a payload to the value just received (LoRa)"
},
"preambleChirps" : {
"type" : "integer",
"description" : "Number of expected preamble chirps"
@ -4522,6 +4526,18 @@ margin-bottom: 20px;
"type" : "integer",
"description" : "Header present before actual payload (LoRa)"
},
"sendViaUDP" : {
"type" : "integer",
"description" : "boolean 1 to send decoded message via UDP else 0"
},
"udpAddress" : {
"type" : "string",
"description" : "UDP destination udpAddress"
},
"udpPort" : {
"type" : "integer",
"description" : "UDP destination properties"
},
"rgbColor" : {
"type" : "integer"
},
@ -32602,7 +32618,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2020-02-23T10:05:51.852+01:00
Generated 2020-02-25T14:33:44.826+01:00
</div>
</div>
</div>

View File

@ -44,6 +44,8 @@ SWGLoRaDemodSettings::SWGLoRaDemodSettings() {
m_eom_squelch_tenths_isSet = false;
nb_symbols_max = 0;
m_nb_symbols_max_isSet = false;
auto_nb_symbols_max = 0;
m_auto_nb_symbols_max_isSet = false;
preamble_chirps = 0;
m_preamble_chirps_isSet = false;
nb_parity_bits = 0;
@ -54,6 +56,12 @@ SWGLoRaDemodSettings::SWGLoRaDemodSettings() {
m_has_crc_isSet = false;
has_header = 0;
m_has_header_isSet = false;
send_via_udp = 0;
m_send_via_udp_isSet = false;
udp_address = nullptr;
m_udp_address_isSet = false;
udp_port = 0;
m_udp_port_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
@ -94,6 +102,8 @@ SWGLoRaDemodSettings::init() {
m_eom_squelch_tenths_isSet = false;
nb_symbols_max = 0;
m_nb_symbols_max_isSet = false;
auto_nb_symbols_max = 0;
m_auto_nb_symbols_max_isSet = false;
preamble_chirps = 0;
m_preamble_chirps_isSet = false;
nb_parity_bits = 0;
@ -104,6 +114,12 @@ SWGLoRaDemodSettings::init() {
m_has_crc_isSet = false;
has_header = 0;
m_has_header_isSet = false;
send_via_udp = 0;
m_send_via_udp_isSet = false;
udp_address = new QString("");
m_udp_address_isSet = false;
udp_port = 0;
m_udp_port_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
@ -138,6 +154,12 @@ SWGLoRaDemodSettings::cleanup() {
if(udp_address != nullptr) {
delete udp_address;
}
if(title != nullptr) {
delete title;
}
@ -178,6 +200,8 @@ SWGLoRaDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&nb_symbols_max, pJson["nbSymbolsMax"], "qint32", "");
::SWGSDRangel::setValue(&auto_nb_symbols_max, pJson["autoNbSymbolsMax"], "qint32", "");
::SWGSDRangel::setValue(&preamble_chirps, pJson["preambleChirps"], "qint32", "");
::SWGSDRangel::setValue(&nb_parity_bits, pJson["nbParityBits"], "qint32", "");
@ -188,6 +212,12 @@ SWGLoRaDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&has_header, pJson["hasHeader"], "qint32", "");
::SWGSDRangel::setValue(&send_via_udp, pJson["sendViaUDP"], "qint32", "");
::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString");
::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", "");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
@ -244,6 +274,9 @@ SWGLoRaDemodSettings::asJsonObject() {
if(m_nb_symbols_max_isSet){
obj->insert("nbSymbolsMax", QJsonValue(nb_symbols_max));
}
if(m_auto_nb_symbols_max_isSet){
obj->insert("autoNbSymbolsMax", QJsonValue(auto_nb_symbols_max));
}
if(m_preamble_chirps_isSet){
obj->insert("preambleChirps", QJsonValue(preamble_chirps));
}
@ -259,6 +292,15 @@ SWGLoRaDemodSettings::asJsonObject() {
if(m_has_header_isSet){
obj->insert("hasHeader", QJsonValue(has_header));
}
if(m_send_via_udp_isSet){
obj->insert("sendViaUDP", QJsonValue(send_via_udp));
}
if(udp_address != nullptr && *udp_address != QString("")){
toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString"));
}
if(m_udp_port_isSet){
obj->insert("udpPort", QJsonValue(udp_port));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
@ -367,6 +409,16 @@ SWGLoRaDemodSettings::setNbSymbolsMax(qint32 nb_symbols_max) {
this->m_nb_symbols_max_isSet = true;
}
qint32
SWGLoRaDemodSettings::getAutoNbSymbolsMax() {
return auto_nb_symbols_max;
}
void
SWGLoRaDemodSettings::setAutoNbSymbolsMax(qint32 auto_nb_symbols_max) {
this->auto_nb_symbols_max = auto_nb_symbols_max;
this->m_auto_nb_symbols_max_isSet = true;
}
qint32
SWGLoRaDemodSettings::getPreambleChirps() {
return preamble_chirps;
@ -417,6 +469,36 @@ SWGLoRaDemodSettings::setHasHeader(qint32 has_header) {
this->m_has_header_isSet = true;
}
qint32
SWGLoRaDemodSettings::getSendViaUdp() {
return send_via_udp;
}
void
SWGLoRaDemodSettings::setSendViaUdp(qint32 send_via_udp) {
this->send_via_udp = send_via_udp;
this->m_send_via_udp_isSet = true;
}
QString*
SWGLoRaDemodSettings::getUdpAddress() {
return udp_address;
}
void
SWGLoRaDemodSettings::setUdpAddress(QString* udp_address) {
this->udp_address = udp_address;
this->m_udp_address_isSet = true;
}
qint32
SWGLoRaDemodSettings::getUdpPort() {
return udp_port;
}
void
SWGLoRaDemodSettings::setUdpPort(qint32 udp_port) {
this->udp_port = udp_port;
this->m_udp_port_isSet = true;
}
qint32
SWGLoRaDemodSettings::getRgbColor() {
return rgb_color;
@ -526,6 +608,9 @@ SWGLoRaDemodSettings::isSet(){
if(m_nb_symbols_max_isSet){
isObjectUpdated = true; break;
}
if(m_auto_nb_symbols_max_isSet){
isObjectUpdated = true; break;
}
if(m_preamble_chirps_isSet){
isObjectUpdated = true; break;
}
@ -541,6 +626,15 @@ SWGLoRaDemodSettings::isSet(){
if(m_has_header_isSet){
isObjectUpdated = true; break;
}
if(m_send_via_udp_isSet){
isObjectUpdated = true; break;
}
if(udp_address && *udp_address != QString("")){
isObjectUpdated = true; break;
}
if(m_udp_port_isSet){
isObjectUpdated = true; break;
}
if(m_rgb_color_isSet){
isObjectUpdated = true; break;
}

View File

@ -66,6 +66,9 @@ public:
qint32 getNbSymbolsMax();
void setNbSymbolsMax(qint32 nb_symbols_max);
qint32 getAutoNbSymbolsMax();
void setAutoNbSymbolsMax(qint32 auto_nb_symbols_max);
qint32 getPreambleChirps();
void setPreambleChirps(qint32 preamble_chirps);
@ -81,6 +84,15 @@ public:
qint32 getHasHeader();
void setHasHeader(qint32 has_header);
qint32 getSendViaUdp();
void setSendViaUdp(qint32 send_via_udp);
QString* getUdpAddress();
void setUdpAddress(QString* udp_address);
qint32 getUdpPort();
void setUdpPort(qint32 udp_port);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
@ -133,6 +145,9 @@ private:
qint32 nb_symbols_max;
bool m_nb_symbols_max_isSet;
qint32 auto_nb_symbols_max;
bool m_auto_nb_symbols_max_isSet;
qint32 preamble_chirps;
bool m_preamble_chirps_isSet;
@ -148,6 +163,15 @@ private:
qint32 has_header;
bool m_has_header_isSet;
qint32 send_via_udp;
bool m_send_via_udp_isSet;
QString* udp_address;
bool m_udp_address_isSet;
qint32 udp_port;
bool m_udp_port_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;