better heared station function

This commit is contained in:
richonguzman
2024-05-05 08:16:15 -04:00
parent db24293b91
commit 71c5e608b6
4 changed files with 4 additions and 9 deletions
+1 -2
View File
@@ -53,7 +53,6 @@ uint32_t bmeLastReading = -60000;
String batteryVoltage;
std::vector<String> lastHeardStation;
std::vector<String> lastHeardStation_temp;
std::vector<String> outputPacketBuffer;
uint32_t lastTxTime = millis();
uint32_t lastRxTime = millis();
@@ -172,7 +171,7 @@ void loop() {
#ifdef ESP32_DIY_LoRa_A7670
if (Config.aprs_is.active && !modemLoggedToAPRSIS) {
A7670_Utils::APRS_IS_connect();
}
}
#else
if (Config.aprs_is.active && !espClient.connected()) {
APRS_IS_Utils::connect();
+2 -5
View File
@@ -158,13 +158,12 @@ namespace APRS_IS_Utils {
if (packet != "") {
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("TCPIP") == -1) && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
Sender = packet.substring(3, packet.indexOf(">"));
STATION_Utils::updateLastHeard(Sender);
Utils::typeOfPacket(aprsPacket, "LoRa-APRS");
if (Sender != Config.callsign) { // avoid listening yourself by digirepeating
STATION_Utils::updateLastHeard(Sender);
Utils::typeOfPacket(aprsPacket, "LoRa-APRS");
AddresseeAndMessage = packet.substring(packet.indexOf("::") + 2);
Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
Addressee.trim();
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
queryMessage = processReceivedLoRaMessage(Sender, AddresseeAndMessage);
}
@@ -182,8 +181,6 @@ namespace APRS_IS_Utils {
upload(aprsPacket);
#endif
Utils::println("---> Uploaded to APRS-IS");
STATION_Utils::updateLastHeard(Sender);
Utils::typeOfPacket(aprsPacket, "LoRa-APRS");
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
}
}
-1
View File
@@ -3,7 +3,6 @@
extern Configuration Config;
extern std::vector<String> lastHeardStation;
extern std::vector<String> lastHeardStation_temp;
extern String versionDate;
+1 -1
View File
@@ -7,7 +7,6 @@
extern Configuration Config;
extern std::vector<String> lastHeardStation;
extern std::vector<String> lastHeardStation_temp;
extern std::vector<String> outputPacketBuffer;
extern uint32_t lastTxTime;
extern uint32_t lastRxTime;
@@ -17,6 +16,7 @@ extern String fourthLine;
namespace STATION_Utils {
void deleteNotHeard() {
std::vector<String> lastHeardStation_temp;
for (int i = 0; i < lastHeardStation.size(); i++) {
String deltaTimeString = lastHeardStation[i].substring(lastHeardStation[i].indexOf(",") + 1);
uint32_t deltaTime = deltaTimeString.toInt();