mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-20 12:15:21 +01:00
syslog update
This commit is contained in:
parent
9fbf105241
commit
52a77a2746
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue