syslog update

This commit is contained in:
richonguzman 2024-01-22 08:11:27 -03:00
parent 9fbf105241
commit 52a77a2746
2 changed files with 5 additions and 5 deletions

View file

@ -120,7 +120,7 @@ namespace LoRa_Utils {
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
digitalWrite(internalLedPin,LOW);
#endif
SYSLOG_Utils::log("LoRa Tx", newPacket,0,0,0);
SYSLOG_Utils::log("Tx", newPacket,0,0,0);
Serial.print("---> LoRa Packet Tx : ");
Serial.println(newPacket);
}
@ -173,7 +173,7 @@ namespace LoRa_Utils {
}
#endif
if (Config.syslog.active && (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status()==WL_CONNECTED)) && loraPacket!="") {
SYSLOG_Utils::log("LoRa Rx", loraPacket, rssi, snr, freqError);
SYSLOG_Utils::log("Rx", loraPacket, rssi, snr, freqError);
}
return loraPacket;
}

View file

@ -12,13 +12,13 @@ WiFiUDP udpClient;
namespace SYSLOG_Utils {
void log(String type, String packet, int rssi, float snr, int freqError) {
String syslogPacket = "<165>1 - " + Config.callsign + " LoRa" + " - - - "; //RFC5424 The Syslog Protocol
String syslogPacket = "<165>1 - " + Config.callsign + " CA2RXU_LoRa_iGate 1.2" + " - - - "; //RFC5424 The Syslog Protocol
if (Config.syslog.active && (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status()==WL_CONNECTED))) {
if (type == "APRSIS Tx") {
if (packet.indexOf(":>") > 10) {
syslogPacket += type + " / StartUp STATUS / " + packet.substring(packet.indexOf(":>")+2);
}
} else if (type == "LoRa Rx") {
} else if (type == "Rx") {
if (packet.indexOf("::") > 10) {
syslogPacket += type + " / MESSAGE / " + packet.substring(3,packet.indexOf(">")) + " ---> " + packet.substring(packet.indexOf("::")+2);
syslogPacket += " / " + String(rssi) + "dBm / " + String(snr) + "dB / " + String(freqError) + "Hz";
@ -46,7 +46,7 @@ namespace SYSLOG_Utils {
syslogPacket += type + " / " + packet;
syslogPacket += " / " + String(rssi) + "dBm / " + String(snr) + "dB / " + String(freqError) + "Hz";
}
} else if (type == "LoRa Tx") {
} else if (type == "Tx") {
if (packet.indexOf("RFONLY") > 10) {
syslogPacket += type + " / RFONLY / " + packet;
} else if (packet.indexOf("::") > 10) {