diff --git a/data/igate_conf.json b/data/igate_conf.json index 3dc3a80..8c4d27f 100644 --- a/data/igate_conf.json +++ b/data/igate_conf.json @@ -1,6 +1,6 @@ { "callsign": "CD2RXU-11", - "stationMode": 2, + "stationMode": 3, "iGateComment": "LoRa_APRS_iGate", "wifi": { "AP": [ @@ -18,8 +18,8 @@ }, "digi": { "comment": "LoRa_APRS_Digirepeater", - "latitude": 0.0000000, - "longitude": 0.0000000 + "latitude": -32.8805195, + "longitude": -71.4282433 }, "aprs_is": { "passcode": "23201", diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 1aec632..6b616cb 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -20,7 +20,7 @@ Configuration Config; WiFiClient espClient; -String versionDate = "2023.09.03"; +String versionDate = "2023.09.05"; int myWiFiAPIndex = 0; int myWiFiAPSize = Config.wifiAPs.size(); WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex]; @@ -40,6 +40,8 @@ String batteryVoltage; std::vector lastHeardStation; std::vector lastHeardStation_temp; +std::vector packetBuffer; +std::vector packetBuffer_temp; String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, iGateBeaconPacket; diff --git a/src/digi_utils.cpp b/src/digi_utils.cpp index d55065d..d175d1a 100644 --- a/src/digi_utils.cpp +++ b/src/digi_utils.cpp @@ -29,6 +29,7 @@ void processPacket(String packet) { Serial.println(" ---> APRS LoRa Packet"); String sender = packet.substring(3,packet.indexOf(">")); STATION_Utils::updateLastHeard(sender); + STATION_Utils::updatePacketBuffer(packet); Utils::typeOfPacket(packet, "Digi"); if ((stationMode==3 || stationMode==5) && (packet.indexOf("WIDE1-1") > 10)) { loraPacket = packet.substring(3); diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 4d9278a..edfad8a 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -5,6 +5,8 @@ extern Configuration Config; extern std::vector lastHeardStation; extern std::vector lastHeardStation_temp; +extern std::vector packetBuffer; +extern std::vector packetBuffer_temp; extern String fourthLine; namespace STATION_Utils { @@ -63,4 +65,39 @@ bool wasHeard(String station) { return false; } +void checkBuffer() { + for (int i=0; i") == -1)) { + String sender = packet.substring(3,packet.indexOf(">")); + String tempAddressee = packet.substring(packet.indexOf("::") + 2); + String addressee = tempAddressee.substring(0,tempAddressee.indexOf(":")); + addressee.trim(); + String message = tempAddressee.substring(tempAddressee.indexOf(":")+1); + //Serial.println(String(millis()) + "," + sender + "," + addressee + "," + message); + packetBuffer.push_back(String(millis()) + "," + sender + "," + addressee + "," + message); + checkBuffer(); + } +} + + } \ No newline at end of file diff --git a/src/station_utils.h b/src/station_utils.h index 2da92d1..cfe857a 100644 --- a/src/station_utils.h +++ b/src/station_utils.h @@ -8,6 +8,8 @@ namespace STATION_Utils { void deleteNotHeard(); void updateLastHeard(String station); bool wasHeard(String station); +void checkBuffer(); +void updatePacketBuffer(String packet); }