updated QueryAnswer for 3rdPartyPacket
This commit is contained in:
parent
413bef67fb
commit
848492dc36
|
|
@ -37,7 +37,7 @@ ________________________________________________________________________________
|
||||||
#include "A7670_utils.h"
|
#include "A7670_utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String versionDate = "2024.06.27";
|
String versionDate = "2024.06.28";
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace APRS_IS_Utils {
|
||||||
aprsauth += Config.callsign;
|
aprsauth += Config.callsign;
|
||||||
aprsauth += " pass ";
|
aprsauth += " pass ";
|
||||||
aprsauth += Config.aprs_is.passcode;
|
aprsauth += Config.aprs_is.passcode;
|
||||||
aprsauth += " vers CA2RXU_LoRa_iGate 1.3 filter ";
|
aprsauth += " vers CA2RXU_LoRa_iGate 1.4 filter ";
|
||||||
aprsauth += Config.aprs_is.filter;
|
aprsauth += Config.aprs_is.filter;
|
||||||
upload(aprsauth);
|
upload(aprsauth);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
|
@ -129,7 +129,7 @@ namespace APRS_IS_Utils {
|
||||||
return buildedPacket;
|
return buildedPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool processReceivedLoRaMessage(const String& sender, const String& packet) {
|
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty) {
|
||||||
String receivedMessage;
|
String receivedMessage;
|
||||||
if (packet.indexOf("{") > 0) { // ack?
|
if (packet.indexOf("{") > 0) { // ack?
|
||||||
String ackMessage = "ack";
|
String ackMessage = "ack";
|
||||||
|
|
@ -162,7 +162,7 @@ namespace APRS_IS_Utils {
|
||||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
||||||
display_toggle(true);
|
display_toggle(true);
|
||||||
}
|
}
|
||||||
STATION_Utils::addToOutputPacketBuffer(QUERY_Utils::process(receivedMessage, sender, 0)); // LoRa
|
STATION_Utils::addToOutputPacketBuffer(QUERY_Utils::process(receivedMessage, sender, false, thirdParty));
|
||||||
lastScreenOn = millis();
|
lastScreenOn = millis();
|
||||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + sender, "TYPE --> QUERY", 0);
|
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + sender, "TYPE --> QUERY", 0);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -187,7 +187,7 @@ namespace APRS_IS_Utils {
|
||||||
Addressee.trim();
|
Addressee.trim();
|
||||||
bool queryMessage = false;
|
bool queryMessage = false;
|
||||||
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
|
if (packet.indexOf("::") > 10 && Addressee == Config.callsign) { // its a message for me!
|
||||||
queryMessage = processReceivedLoRaMessage(Sender, checkForStartingBytes(AddresseeAndMessage));
|
queryMessage = processReceivedLoRaMessage(Sender, checkForStartingBytes(AddresseeAndMessage), false);
|
||||||
}
|
}
|
||||||
if (!queryMessage) {
|
if (!queryMessage) {
|
||||||
const String& aprsPacket = buildPacketToUpload(packet);
|
const String& aprsPacket = buildPacketToUpload(packet);
|
||||||
|
|
@ -291,7 +291,7 @@ namespace APRS_IS_Utils {
|
||||||
}
|
}
|
||||||
if (receivedMessage.indexOf("?") == 0) {
|
if (receivedMessage.indexOf("?") == 0) {
|
||||||
Utils::println("Received Query APRS-IS : " + packet);
|
Utils::println("Received Query APRS-IS : " + packet);
|
||||||
String queryAnswer = QUERY_Utils::process(receivedMessage, Sender, 1); // APRSIS
|
String queryAnswer = QUERY_Utils::process(receivedMessage, Sender, true, false);
|
||||||
//Serial.println("---> QUERY Answer : " + queryAnswer.substring(0,queryAnswer.indexOf("\n")));
|
//Serial.println("---> QUERY Answer : " + queryAnswer.substring(0,queryAnswer.indexOf("\n")));
|
||||||
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
if (!Config.display.alwaysOn && Config.display.timeout != 0) {
|
||||||
display_toggle(true);
|
display_toggle(true);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace APRS_IS_Utils {
|
||||||
String checkForStartingBytes(const String& packet);
|
String checkForStartingBytes(const String& packet);
|
||||||
|
|
||||||
String buildPacketToUpload(const String& packet);
|
String buildPacketToUpload(const String& packet);
|
||||||
bool processReceivedLoRaMessage(const String& sender, const String& packet);
|
bool processReceivedLoRaMessage(const String& sender, const String& packet, bool thirdParty);
|
||||||
void processLoRaPacket(const String& packet);
|
void processLoRaPacket(const String& packet);
|
||||||
|
|
||||||
String buildPacketToTx(const String& aprsisPacket, uint8_t packetType);
|
String buildPacketToTx(const String& aprsisPacket, uint8_t packetType);
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace DIGI_Utils {
|
||||||
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
|
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
|
||||||
Addressee.trim();
|
Addressee.trim();
|
||||||
if (Addressee == Config.callsign) { // it's a message for me!
|
if (Addressee == Config.callsign) { // it's a message for me!
|
||||||
queryMessage = APRS_IS_Utils::processReceivedLoRaMessage(Sender, AddresseeAndMessage);
|
queryMessage = APRS_IS_Utils::processReceivedLoRaMessage(Sender, AddresseeAndMessage, thirdPartyPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!queryMessage) {
|
if (!queryMessage) {
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,12 @@ extern int freqError;
|
||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
|
|
||||||
String process(const String& query, const String& station, const uint8_t queryOrigin) {
|
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty) {
|
||||||
String answer;
|
String answer;
|
||||||
if (query=="?APRS?" || query=="?aprs?" || query=="?Aprs?" || query=="H" || query=="h" || query=="HELP" || query=="Help" || query=="help" || query=="?") {
|
if (query=="?APRS?" || query=="?aprs?" || query=="?Aprs?" || query=="H" || query=="h" || query=="HELP" || query=="Help" || query=="help" || query=="?") {
|
||||||
answer.concat("?APRSV ?APRSP ?APRSL ?APRSH ?WHERE callsign");
|
answer.concat("?APRSV ?APRSP ?APRSL ?APRSH ?WHERE callsign");
|
||||||
} else if (query=="?APRSV" || query=="?aprsv" || query=="?Aprsv") {
|
} else if (query=="?APRSV" || query=="?aprsv" || query=="?Aprsv") {
|
||||||
answer = "CA2RXU_LoRa_iGate 1.3 v";
|
answer = "CA2RXU_LoRa_iGate 1.4 v";
|
||||||
answer.concat(versionDate);
|
answer.concat(versionDate);
|
||||||
} else if (query=="?APRSP" || query=="?aprsp" || query=="?Aprsp") {
|
} else if (query=="?APRSP" || query=="?aprsp" || query=="?Aprsp") {
|
||||||
answer = "iGate QTH: ";
|
answer = "iGate QTH: ";
|
||||||
|
|
@ -53,18 +53,17 @@ namespace QUERY_Utils {
|
||||||
processedStation += ' ';
|
processedStation += ' ';
|
||||||
}
|
}
|
||||||
String queryAnswer = Config.callsign;
|
String queryAnswer = Config.callsign;
|
||||||
queryAnswer += ">APLRG1,";
|
queryAnswer += ">APLRG1";
|
||||||
if (queryOrigin == 1) { // from APRS-IS
|
if (queryFromAPRSIS) {
|
||||||
queryAnswer += "TCPIP,qAC::";
|
queryAnswer += ",TCPIP,qAC";
|
||||||
} else { // else == 0 , from LoRa
|
} else {
|
||||||
if (Config.beacon.path == "") {
|
if (!thirdParty) queryAnswer += ",RFONLY";
|
||||||
queryAnswer += "RFONLY::";
|
if (Config.beacon.path != "") {
|
||||||
} else {
|
queryAnswer += ",";
|
||||||
queryAnswer += "RFONLY,";
|
|
||||||
queryAnswer += Config.beacon.path;
|
queryAnswer += Config.beacon.path;
|
||||||
queryAnswer += "::";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
queryAnswer += "::";
|
||||||
queryAnswer += processedStation;
|
queryAnswer += processedStation;
|
||||||
queryAnswer += ":";
|
queryAnswer += ":";
|
||||||
queryAnswer += answer;
|
queryAnswer += answer;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
|
|
||||||
String process(const String& query, const String& station, const uint8_t queryOrigin);
|
String process(const String& query, const String& station, bool queryFromAPRSIS, bool thirdParty);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue