kopia lustrzana https://github.com/lora-aprs/LoRa_APRS_iGate
send messages which are coming from aprs is
rodzic
d3a4035c6c
commit
1bda129947
|
@ -45,7 +45,7 @@ OTATask otaTask;
|
||||||
NTPTask ntpTask;
|
NTPTask ntpTask;
|
||||||
FTPTask ftpTask;
|
FTPTask ftpTask;
|
||||||
MQTTTask mqttTask(toMQTT);
|
MQTTTask mqttTask(toMQTT);
|
||||||
AprsIsTask aprsIsTask(toAprsIs);
|
AprsIsTask aprsIsTask(toAprsIs, toModem);
|
||||||
RouterTask routerTask(fromModem, toModem, toAprsIs, toMQTT);
|
RouterTask routerTask(fromModem, toModem, toAprsIs, toMQTT);
|
||||||
BeaconTask beaconTask(toModem, toAprsIs);
|
BeaconTask beaconTask(toModem, toAprsIs);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "TaskAprsIs.h"
|
#include "TaskAprsIs.h"
|
||||||
#include "project_configuration.h"
|
#include "project_configuration.h"
|
||||||
|
|
||||||
AprsIsTask::AprsIsTask(TaskQueue<std::shared_ptr<APRSMessage>> &toAprsIs) : Task(TASK_APRS_IS, TaskAprsIs), _toAprsIs(toAprsIs) {
|
AprsIsTask::AprsIsTask(TaskQueue<std::shared_ptr<APRSMessage>> &toAprsIs, TaskQueue<std::shared_ptr<APRSMessage>> &toModem) : Task(TASK_APRS_IS, TaskAprsIs), _toAprsIs(toAprsIs), _toModem(toModem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AprsIsTask::~AprsIsTask() {
|
AprsIsTask::~AprsIsTask() {
|
||||||
|
@ -30,7 +30,10 @@ bool AprsIsTask::loop(System &system) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_aprs_is.getAPRSMessage();
|
std::shared_ptr<APRSMessage> msg = _aprs_is.getAPRSMessage();
|
||||||
|
if (msg) {
|
||||||
|
_toModem.addElement(msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (!_toAprsIs.empty()) {
|
if (!_toAprsIs.empty()) {
|
||||||
std::shared_ptr<APRSMessage> msg = _toAprsIs.getElement();
|
std::shared_ptr<APRSMessage> msg = _toAprsIs.getElement();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
class AprsIsTask : public Task {
|
class AprsIsTask : public Task {
|
||||||
public:
|
public:
|
||||||
explicit AprsIsTask(TaskQueue<std::shared_ptr<APRSMessage>> &toAprsIs);
|
explicit AprsIsTask(TaskQueue<std::shared_ptr<APRSMessage>> &toAprsIs, TaskQueue<std::shared_ptr<APRSMessage>> &toModem);
|
||||||
virtual ~AprsIsTask();
|
virtual ~AprsIsTask();
|
||||||
|
|
||||||
virtual bool setup(System &system) override;
|
virtual bool setup(System &system) override;
|
||||||
|
@ -18,6 +18,7 @@ private:
|
||||||
APRS_IS _aprs_is;
|
APRS_IS _aprs_is;
|
||||||
|
|
||||||
TaskQueue<std::shared_ptr<APRSMessage>> &_toAprsIs;
|
TaskQueue<std::shared_ptr<APRSMessage>> &_toAprsIs;
|
||||||
|
TaskQueue<std::shared_ptr<APRSMessage>> &_toModem;
|
||||||
|
|
||||||
bool connect(System &system);
|
bool connect(System &system);
|
||||||
};
|
};
|
||||||
|
|
|
@ -164,6 +164,7 @@ bool RadiolibTask::loop(System &system) {
|
||||||
} else {
|
} else {
|
||||||
if (!txEnable) {
|
if (!txEnable) {
|
||||||
// system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX is not enabled", timeString().c_str());
|
// system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX is not enabled", timeString().c_str());
|
||||||
|
_toModem.getElement(); // empty list, otherwise memory will get full.
|
||||||
} else {
|
} else {
|
||||||
if (transmitFlag) {
|
if (transmitFlag) {
|
||||||
// system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX signal detected. Waiting TX", timeString().c_str());
|
// system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX signal detected. Waiting TX", timeString().c_str());
|
||||||
|
|
Ładowanie…
Reference in New Issue