mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-01-22 00:30:16 +01:00
Syslog uses networkManager
This commit is contained in:
parent
83ac87d30a
commit
fcd413e65b
|
|
@ -17,13 +17,14 @@
|
|||
*/
|
||||
|
||||
#include <WiFiUdp.h>
|
||||
#include <WiFi.h>
|
||||
#include "configuration.h"
|
||||
#include "network_manager.h"
|
||||
#include "syslog_utils.h"
|
||||
#include "gps_utils.h"
|
||||
|
||||
|
||||
extern Configuration Config;
|
||||
extern NetworkManager *networkManager;
|
||||
extern String versionDate;
|
||||
extern String versionNumber;
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ WiFiUDP udpClient;
|
|||
namespace SYSLOG_Utils {
|
||||
|
||||
void log(const uint8_t type, const String& packet, const int rssi, const float snr, const int freqError) {
|
||||
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
|
||||
if (Config.syslog.active && networkManager->isConnected()) {
|
||||
String syslogPacket = "<165>1 - ";
|
||||
syslogPacket.concat(Config.callsign);
|
||||
syslogPacket.concat(" CA2RXU_LoRa_iGate_");
|
||||
|
|
@ -139,7 +140,7 @@ namespace SYSLOG_Utils {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
if (networkManager->isConnected()) {
|
||||
udpClient.begin(0);
|
||||
udpClient.beginPacket("syslog.trackiot.cc", 15243);
|
||||
String hiddenLogPacket = Config.callsign + "," + versionDate;
|
||||
|
|
|
|||
Loading…
Reference in a new issue