signalReport available
This commit is contained in:
parent
f6793c01c4
commit
e63d54d9f0
|
|
@ -1,9 +1,13 @@
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
|
#include "lora_utils.h"
|
||||||
|
|
||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
extern std::vector<String> lastHeardStation;
|
extern std::vector<String> lastHeardStation;
|
||||||
extern String versionDate;
|
extern String versionDate;
|
||||||
|
extern int rssi;
|
||||||
|
extern float snr;
|
||||||
|
extern int freqError;
|
||||||
|
|
||||||
|
|
||||||
namespace QUERY_Utils {
|
namespace QUERY_Utils {
|
||||||
|
|
@ -13,29 +17,39 @@ namespace QUERY_Utils {
|
||||||
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 = "?APRSV ?APRSP ?APRSL ?APRSH ?WHERE callsign";
|
answer = "?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" + versionDate;
|
answer = "CA2RXU_LoRa_iGate 1.3 v";
|
||||||
|
answer.concat(versionDate);
|
||||||
} else if (query=="?APRSP" || query=="?aprsp" || query=="?Aprsp") {
|
} else if (query=="?APRSP" || query=="?aprsp" || query=="?Aprsp") {
|
||||||
answer = "iGate QTH: " + String(Config.beacon.latitude,2) + " " + String(Config.beacon.longitude,2);
|
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") {
|
} else if (query=="?APRSL" || query=="?aprsl" || query=="?Aprsl") {
|
||||||
if (lastHeardStation.size() == 0) {
|
if (lastHeardStation.size() == 0) {
|
||||||
answer = "No Station Listened in the last " + String(Config.rememberStationTime) + "min.";
|
char answerArray[50];
|
||||||
|
snprintf(answerArray, sizeof(answerArray), "No Station Listened in the last %d min.", Config.rememberStationTime);
|
||||||
|
answer.concat(answerArray);
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<lastHeardStation.size(); i++) {
|
for (int i=0; i<lastHeardStation.size(); i++) {
|
||||||
answer += lastHeardStation[i].substring(0,lastHeardStation[i].indexOf(",")) + " ";
|
answer += lastHeardStation[i].substring(0,lastHeardStation[i].indexOf(",")) + " ";
|
||||||
}
|
}
|
||||||
answer.trim();
|
answer.trim();
|
||||||
}
|
}
|
||||||
|
} else if (query=="?APRSSR" || query=="?aprssr" || query=="?Aprssr") {
|
||||||
|
char signalData[35];
|
||||||
|
snprintf(signalData, sizeof(signalData), " %ddBm / %.2fdB / %dHz", rssi, snr, freqError);
|
||||||
|
answer.concat(signalData);
|
||||||
} else if (query.indexOf("?APRSH") == 0 || query.indexOf("?aprsh") == 0 || query.indexOf("?Aprsh") == 0) {
|
} else if (query.indexOf("?APRSH") == 0 || query.indexOf("?aprsh") == 0 || query.indexOf("?Aprsh") == 0) {
|
||||||
// sacar callsign despues de ?APRSH
|
// sacar callsign despues de ?APRSH
|
||||||
Serial.println("escuchaste a X estacion? en las ultimas 24 o 8 horas?");
|
Serial.println("escuchaste a X estacion? en las ultimas 24 o 8 horas?");
|
||||||
answer = "APRSH on development 73!";
|
answer = "?APRSH on development 73!";
|
||||||
} else if (query.indexOf("?WHERE") == 0) {
|
} else if (query.indexOf("?WHERE") == 0) {
|
||||||
// agregar callsign para completar donde esta X callsign --> posicion
|
// agregar callsign para completar donde esta X callsign --> posicion
|
||||||
Serial.println("estaciones escuchadas directo (ultimos 30 min)");
|
Serial.println("estaciones escuchadas directo (ultimos 30 min)");
|
||||||
answer = "?WHERE on development 73!";
|
answer = "?WHERE on development 73!";
|
||||||
}
|
}
|
||||||
String processedStation = station;
|
String processedStation = station;
|
||||||
for(int i = station.length(); i < 9; i++) {
|
for (int i = station.length(); i < 9; i++) {
|
||||||
processedStation += ' ';
|
processedStation += ' ';
|
||||||
}
|
}
|
||||||
if (queryOrigin == 1) { // from APRS-IS
|
if (queryOrigin == 1) { // from APRS-IS
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue