mejora Resolucion

This commit is contained in:
richonguzman 2023-06-17 11:10:44 -04:00
parent 8e49b29b9f
commit 08191ebb04
9 changed files with 72 additions and 125 deletions

View file

@ -14,23 +14,24 @@
AsyncWebServer server(80);
extern WiFiClient espClient;
extern Configuration Config;
extern String versionDate;
extern bool statusAfterBoot;
extern String firstLine;
extern String secondLine;
extern String thirdLine;
extern String fourthLine;
extern String fifthLine;
extern String sixthLine;
extern String seventhLine;
extern String eigthLine;
extern uint32_t lastBeaconTx;
extern uint32_t lastScreenOn;
extern bool beacon_update;
extern int stationMode;
extern String iGateBeaconPacket;
extern WiFiClient espClient;
extern Configuration Config;
extern String versionDate;
extern bool statusAfterBoot;
extern String firstLine;
extern String secondLine;
extern String thirdLine;
extern String fourthLine;
extern String fifthLine;
extern String sixthLine;
extern String seventhLine;
extern String eigthLine;
extern uint32_t lastBeaconTx;
extern uint32_t lastScreenOn;
extern bool beacon_update;
extern int stationMode;
extern String iGateBeaconPacket;
extern std::vector<String> lastHeardStation;
namespace Utils {
@ -56,7 +57,7 @@ void processStatus() {
}
String getLocalIP() {
return "IP : " + String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(WiFi.localIP()[3]);
return "IP : " + String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(WiFi.localIP()[3]);
}
void setupDiplay() {
@ -70,7 +71,7 @@ void setupDiplay() {
secondLine = "<DigiRepeater Active>";
} else {
secondLine = "";
}
}
seventhLine = "";
eigthLine = " listening...";
}
@ -85,12 +86,21 @@ void checkBeaconInterval() {
Serial.println("---- Sending iGate Beacon ----");
if (stationMode==1 || stationMode==2) {
thirdLine = getLocalIP();
if (lastHeardStation.size() < 10) {
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
} else {
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
}
//fifthLine = "";
sixthLine = "";
seventhLine = "";
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 1000);
eigthLine = " listening...";
espClient.write((iGateBeaconPacket + "\n").c_str());
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, 0);
} else if (stationMode==3 || stationMode==4) {
fifthLine = "";
sixthLine = "";
seventhLine = "";
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 0);
eigthLine = " listening...";
@ -130,20 +140,42 @@ void validateDigiFreqs() {
}
}
void typeOfPacket(String packet) {
void typeOfPacket(String packet, String packetType) {
String sender;
if (stationMode==1 || stationMode==2) {
seventhLine = "Callsign = " + packet.substring(0,packet.indexOf(">"));
if (packetType == "LoRa-APRS") {
sixthLine = "LoRa Rx ----> APRS-IS";
} else if (packetType == "APRS-LoRa") {
sixthLine = "APRS-IS ----> LoRa Tx";
}
sender = packet.substring(0,packet.indexOf(">"));
} else {
seventhLine = "Callsign = " + packet.substring(3,packet.indexOf(">"));
sixthLine = "LoRa Rx ----> LoRa Tx";
sender = packet.substring(3,packet.indexOf(">"));
}
for (int i=sender.length();i<9;i++) {
sender += " ";
}
if (packet.indexOf("::") >= 10) {
eigthLine = "TYPE ----> MESSAGE";
if (packetType == "APRS-LoRa") {
String addresseeAndMessage = packet.substring(packet.indexOf("::")+2);
String addressee = addresseeAndMessage.substring(0, addresseeAndMessage.indexOf(":"));
addressee.trim();
seventhLine = sender + " > " + addressee;
Serial.println("mensaje desde " + seventhLine);
} else {
seventhLine = sender + "> MESSAGE";
}
eigthLine = "RSSI: 38dBm SNR: 6dBm";
} else if (packet.indexOf(":>") >= 10) {
eigthLine = "TYPE ----> NEW STATUS";
seventhLine = sender + "> NEW STATUS";
eigthLine = "RSSI: 38dBm SNR: 6dBm";
} else if (packet.indexOf(":!") >= 10 || packet.indexOf(":=") >= 10) {
eigthLine = "TYPE ----> GPS BEACON";
seventhLine = sender + "> GPS BEACON";
eigthLine = "RSSI:38dBm D: 25.6km";
} else {
eigthLine = "TYPE ----> ??????????";
seventhLine = sender + "> ??????????";
eigthLine = "RSSI: 38dBm SNR: 6dBm";
}
}