#include "configuration.h" #include "query_utils.h" #include "lora_utils.h" extern Configuration Config; extern std::vector lastHeardStation; extern String versionDate; extern int rssi; extern float snr; extern int freqError; namespace QUERY_Utils { String process(const String& query, const String& station, uint8_t queryOrigin) { String answer; if (query=="?APRS?" || query=="?aprs?" || query=="?Aprs?" || query=="H" || query=="h" || query=="HELP" || query=="Help" || query=="help" || query=="?") { answer = "?APRSV ?APRSP ?APRSL ?APRSH ?WHERE callsign"; } else if (query=="?APRSV" || query=="?aprsv" || query=="?Aprsv") { answer = "CA2RXU_LoRa_iGate 1.3 v"; answer.concat(versionDate); } else if (query=="?APRSP" || query=="?aprsp" || query=="?Aprsp") { answer = "iGate QTH: "; answer.concat(String(Config.beacon.latitude,2)); answer.concat(" "); answer.concat(String(Config.beacon.longitude,2)); } else if (query=="?APRSL" || query=="?aprsl" || query=="?Aprsl") { if (lastHeardStation.size() == 0) { char answerArray[50]; snprintf(answerArray, sizeof(answerArray), "No Station Listened in the last %d min.", Config.rememberStationTime); answer.concat(answerArray); } else { for (int i=0; i posicion Serial.println("estaciones escuchadas directo (ultimos 30 min)"); answer = "?WHERE on development 73!"; } String processedStation = station; for (int i = station.length(); i < 9; i++) { processedStation += ' '; } if (queryOrigin == 1) { // from APRS-IS return Config.callsign + ">APLRG1,TCPIP,qAC::" + processedStation + ":" + answer; } else { // else == 0 , from LoRa if (Config.beacon.path == "") { return Config.callsign + ">APLRG1,RFONLY::" + processedStation + ":" + answer; } else { return Config.callsign + ">APLRG1,RFONLY," + Config.beacon.path + "::" + processedStation + ":" + answer; } } } }