basic Tracker Mode added

This commit is contained in:
richonguzman 2023-09-05 18:33:42 -03:00
parent dacf5028a7
commit fba9460216
5 changed files with 33 additions and 21 deletions

View File

@ -60,6 +60,7 @@
"power": 20
},
"other": {
"simplifiedTrackerMode": false,
"showSymbolOnScreen": true,
"sendCommentAfterXBeacons": 10,
"displayEcoMode": false,

View File

@ -29,7 +29,7 @@ TinyGPSPlus gps;
BluetoothSerial SerialBT;
OneButton userButton = OneButton(BUTTON_PIN, true, true);
String versionDate = "2023.08.26";
String versionDate = "2023.09.05";
int myBeaconsIndex = 0;
int myBeaconsSize = Config.beacons.size();
@ -93,9 +93,11 @@ void setup() {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "WiFi controller stopped");
BLUETOOTH_Utils::setup();
userButton.attachClick(BUTTON_Utils::singlePress);
userButton.attachLongPressStart(BUTTON_Utils::longPress);
userButton.attachDoubleClick(BUTTON_Utils::doublePress);
if (!Config.simplifiedTrackerMode) {
userButton.attachClick(BUTTON_Utils::singlePress);
userButton.attachLongPressStart(BUTTON_Utils::longPress);
userButton.attachDoubleClick(BUTTON_Utils::doublePress);
}
powerManagement.lowerCpuFrequency();
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "Smart Beacon is: %s", utils::getSmartBeaconState());
@ -104,14 +106,15 @@ void setup() {
}
void loop() {
//Serial.println(BME_Utils::readDataSensor());
currentBeacon = &Config.beacons[myBeaconsIndex];
if (statusState) {
Config.validateConfigFile(currentBeacon->callsign);
}
powerManagement.batteryManager();
userButton.tick();
if (!Config.simplifiedTrackerMode) {
userButton.tick();
}
utils::checkDisplayEcoMode();
GPS_Utils::getData();

View File

@ -59,6 +59,7 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
bme.active = data["bme"]["active"].as<bool>();
simplifiedTrackerMode = data["other"]["simplifiedTrackerMode"].as<bool>();
showSymbolOnScreen = data["other"]["showSymbolOnScreen"].as<bool>();
sendCommentAfterXBeacons = data["other"]["sendCommentAfterXBeacons"].as<int>();
displayEcoMode = data["other"]["displayEcoMode"].as<bool>();

View File

@ -53,6 +53,7 @@ public:
Ptt ptt;
BME bme;
bool simplifiedTrackerMode;
bool showSymbolOnScreen;
int sendCommentAfterXBeacons;
bool displayEcoMode;

View File

@ -189,27 +189,33 @@ namespace MSG_Utils {
menuTime = millis();
} else {
show_display("< MSG Rx >", "From --> " + Sender, "", receivedMessage , 3000);
saveNewMessage("APRS", Sender, receivedMessage);
if (!Config.simplifiedTrackerMode) {
saveNewMessage("APRS", Sender, receivedMessage);
}
}
} else {
show_display("< MSG >", "From --> " + Sender, "", receivedMessage , 3000);
saveNewMessage("APRS", Sender, receivedMessage);
if (!Config.simplifiedTrackerMode) {
saveNewMessage("APRS", Sender, receivedMessage);
}
}
}
} else if (packetReceived.indexOf(":!") > 10 || packetReceived.indexOf(":=") > 10 ) { // packetReceived has APRS - GPS info
lastHeardTracker = Sender; // eliminar?
int encodedBytePosition = 0;
if (packetReceived.indexOf(":!") > 10) {
encodedBytePosition = packetReceived.indexOf(":!") + 14;
}
if (packetReceived.indexOf(":=") > 10) {
encodedBytePosition = packetReceived.indexOf(":=") + 14;
}
if (encodedBytePosition != 0) {
if (String(packetReceived[encodedBytePosition]) == "G" || String(packetReceived[encodedBytePosition]) == "Q") {
GPS_Utils::decodeEncodedGPS(packetReceived, Sender);
} else {
GPS_Utils::getReceivedGPS(packetReceived, Sender);
lastHeardTracker = Sender;
if (!Config.simplifiedTrackerMode) {
int encodedBytePosition = 0;
if (packetReceived.indexOf(":!") > 10) {
encodedBytePosition = packetReceived.indexOf(":!") + 14;
}
if (packetReceived.indexOf(":=") > 10) {
encodedBytePosition = packetReceived.indexOf(":=") + 14;
}
if (encodedBytePosition != 0) {
if (String(packetReceived[encodedBytePosition]) == "G" || String(packetReceived[encodedBytePosition]) == "Q") {
GPS_Utils::decodeEncodedGPS(packetReceived, Sender);
} else {
GPS_Utils::getReceivedGPS(packetReceived, Sender);
}
}
}
}