mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-01-27 19:04:20 +01:00
testing Queries for DigiMode
This commit is contained in:
parent
3fda399ecf
commit
e059c65a99
|
|
@ -49,7 +49,7 @@ namespace APRS_IS_Utils {
|
|||
|
||||
// String filter = "t/m/" + Config.callsign + "/" + (String)Config.aprs_is.reportingDistance;
|
||||
|
||||
aprsauth = "user " + Config.callsign + " pass " + Config.aprs_is.passcode + " vers CA2RXU_LoRa_iGate 1.3 filter " + Config.aprs_is.filter;// + "\r\n";
|
||||
aprsauth = "user " + Config.callsign + " pass " + Config.aprs_is.passcode + " vers CA2RXU_LoRa_iGate 1.3 filter " + Config.aprs_is.filter;
|
||||
upload(aprsauth);
|
||||
delay(200);
|
||||
}
|
||||
|
|
@ -82,15 +82,15 @@ namespace APRS_IS_Utils {
|
|||
|
||||
lastScreenOn = millis();
|
||||
}
|
||||
|
||||
|
||||
secondLine = "WiFi: " + wifiState + " APRS-IS: " + aprsisState;
|
||||
}
|
||||
|
||||
String createPacket(String packet) {
|
||||
if (!(Config.aprs_is.active && Config.digi.mode == 0)) { // Check if NOT only IGate
|
||||
return packet.substring(3, packet.indexOf(":")) + ",qAR," + Config.callsign + packet.substring(packet.indexOf(":"));// + "\n";
|
||||
return packet.substring(3, packet.indexOf(":")) + ",qAR," + Config.callsign + packet.substring(packet.indexOf(":"));
|
||||
} else {
|
||||
return packet.substring(3, packet.indexOf(":")) + ",qAO," + Config.callsign + packet.substring(packet.indexOf(":"));// + "\n";
|
||||
return packet.substring(3, packet.indexOf(":")) + ",qAO," + Config.callsign + packet.substring(packet.indexOf(":"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ namespace APRS_IS_Utils {
|
|||
Addressee = AddresseeAndMessage.substring(0,AddresseeAndMessage.indexOf(":"));
|
||||
Addressee.trim();
|
||||
|
||||
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
|
||||
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
|
||||
if (AddresseeAndMessage.indexOf("{")>0) { // ack?
|
||||
ackMessage = "ack" + AddresseeAndMessage.substring(AddresseeAndMessage.indexOf("{")+1);
|
||||
ackMessage.trim();
|
||||
|
|
@ -218,7 +218,7 @@ namespace APRS_IS_Utils {
|
|||
}
|
||||
}
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "configuration.h"
|
||||
#include "station_utils.h"
|
||||
#include "aprs_is_utils.h"
|
||||
#include "query_utils.h"
|
||||
#include "lora_utils.h"
|
||||
#include "digi_utils.h"
|
||||
#include "wifi_utils.h"
|
||||
|
|
@ -52,16 +53,45 @@ namespace DIGI_Utils {
|
|||
}
|
||||
|
||||
void processPacket(String packet) {
|
||||
String loraPacket;
|
||||
bool queryMessage = false;
|
||||
String loraPacket, Sender, AddresseeAndMessage, Addressee, ackMessage, receivedMessage;
|
||||
if (packet != "") {
|
||||
Serial.print("Received Lora Packet : " + String(packet));
|
||||
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1)) {
|
||||
if (packet.substring(0, 3) == "\x3c\xff\x01") {
|
||||
Serial.println(" ---> APRS LoRa Packet");
|
||||
String sender = packet.substring(3,packet.indexOf(">"));
|
||||
STATION_Utils::updateLastHeard(sender);
|
||||
Sender = packet.substring(3,packet.indexOf(">"));
|
||||
STATION_Utils::updateLastHeard(Sender);
|
||||
STATION_Utils::updatePacketBuffer(packet);
|
||||
Utils::typeOfPacket(packet.substring(3), "Digi");
|
||||
if (packet.indexOf("WIDE1-") > 10 && Config.digi.mode == 2) { // If should repeat packet (WIDE1 Digi)
|
||||
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!
|
||||
if (AddresseeAndMessage.indexOf("{")>0) { // ack?
|
||||
ackMessage = "ack" + AddresseeAndMessage.substring(AddresseeAndMessage.indexOf("{")+1);
|
||||
ackMessage.trim();
|
||||
delay(4000);
|
||||
//Serial.println(ackMessage);
|
||||
for(int i = Sender.length(); i < 9; i++) {
|
||||
Sender += ' ';
|
||||
}
|
||||
LoRa_Utils::sendNewPacket("APRS", Config.callsign + ">APLRG1,RFONLY,WIDE1-1::" + Sender + ":" + ackMessage);
|
||||
receivedMessage = AddresseeAndMessage.substring(AddresseeAndMessage.indexOf(":")+1, AddresseeAndMessage.indexOf("{"));
|
||||
} else {
|
||||
receivedMessage = AddresseeAndMessage.substring(AddresseeAndMessage.indexOf(":")+1);
|
||||
}
|
||||
if (receivedMessage.indexOf("?") == 0) {
|
||||
queryMessage = true;
|
||||
delay(2000);
|
||||
if (!Config.display.alwaysOn) {
|
||||
display_toggle(true);
|
||||
}
|
||||
LoRa_Utils::sendNewPacket("APRS", QUERY_Utils::process(receivedMessage, Sender, "LoRa"));
|
||||
lastScreenOn = millis();
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + Sender, "TYPE --> QUERY", 0);
|
||||
}
|
||||
}
|
||||
if (!queryMessage && packet.indexOf("WIDE1-") > 10 && Config.digi.mode == 2) { // If should repeat packet (WIDE1 Digi)
|
||||
loraPacket = generateDigiRepeatedPacket(packet.substring(3), Config.callsign);
|
||||
if (loraPacket != "") {
|
||||
delay(500);
|
||||
|
|
@ -70,7 +100,7 @@ namespace DIGI_Utils {
|
|||
display_toggle(true);
|
||||
lastScreenOn = millis();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Serial.println(" ---> LoRa Packet Ignored (first 3 bytes or NOGATE)\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue