improved Winlink experience

This commit is contained in:
richonguzman 2024-04-26 16:28:14 -04:00
parent d826edc2a3
commit 0f8bc808da
6 changed files with 40 additions and 27 deletions

View File

@ -127,6 +127,7 @@ String winlinkSubject = "";
String winlinkBody = ""; String winlinkBody = "";
String winlinkAlias = ""; String winlinkAlias = "";
String winlinkAliasComplete = ""; String winlinkAliasComplete = "";
bool winlinkCommentState = false;
APRSPacket lastReceivedPacket; APRSPacket lastReceivedPacket;

View File

@ -53,6 +53,7 @@ extern String winlinkSubject;
extern String winlinkBody; extern String winlinkBody;
extern String winlinkAlias; extern String winlinkAlias;
extern String winlinkAliasComplete; extern String winlinkAliasComplete;
extern bool winlinkCommentState;
bool mouseUpState = 0; bool mouseUpState = 0;
bool mouseDownState = 0; bool mouseDownState = 0;
@ -410,13 +411,12 @@ namespace KEYBOARD_Utils {
} else if (menuDisplay == 52) { } else if (menuDisplay == 52) {
menuDisplay = 50111; menuDisplay = 50111;
} else if (menuDisplay == 53) { } else if (menuDisplay == 53) {
if (gps.location.lat() != 0.0) { if (winlinkCommentState) {
String packet = APRSPacketLib::generateGPSBeaconPacket(currentBeacon->callsign, "APLRT1", Config.path, currentBeacon->overlay, APRSPacketLib::encodeGPS(gps.location.lat(),gps.location.lng(), gps.course.deg(), gps.speed.knots(), currentBeacon->symbol, Config.sendAltitude, gps.altitude.feet(), sendStandingUpdate, "GPS")); winlinkCommentState = false;
packet += "winlink"; show_display("_WINLINK_>", "", " WLNK COMMENTs OFF!", 2000);
show_display("<<< TX >>>", "", packet,100);
LoRa_Utils::sendNewPacket(packet);
} else { } else {
show_display("___INFO___", "", " WAITING FOR GPS FIX", 2000); winlinkCommentState = true;
show_display("_WINLINK_>", "", " WLNK COMMENTs ON!", 2000);
} }
} else if (menuDisplay == 5000) { } else if (menuDisplay == 5000) {
MSG_Utils::sendMessage(1, "WLNK-1", "L"); MSG_Utils::sendMessage(1, "WLNK-1", "L");

View File

@ -42,6 +42,7 @@ extern String winlinkSubject;
extern String winlinkBody; extern String winlinkBody;
extern String winlinkAlias; extern String winlinkAlias;
extern String winlinkAliasComplete; extern String winlinkAliasComplete;
extern bool winlinkCommentState;
String freqChangeWarning; String freqChangeWarning;
@ -335,17 +336,17 @@ namespace MENU_Utils {
if (winlinkStatus == 5) { if (winlinkStatus == 5) {
menuDisplay = 5000; menuDisplay = 5000;
} else { } else {
show_display("_WINLINK_>", "> Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", " Quick Check" , lastLine); show_display("_WINLINK_>", "> Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", " Wnlk Comment (" + checkProcessActive(winlinkCommentState) + ")" , lastLine);
} }
break; break;
case 51: // 5.Winlink case 51: // 5.Winlink
show_display("_WINLINK_>", " Login" , "> Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", " Quick Check" , lastLine); show_display("_WINLINK_>", " Login" , "> Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", " Wnlk Comment (" + checkProcessActive(winlinkCommentState) + ")" , lastLine);
break; break;
case 52: // 5.Winlink case 52: // 5.Winlink
show_display("_WINLINK_>", " Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", "> Delete SavedMails", " Quick Check" , lastLine); show_display("_WINLINK_>", " Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", "> Delete SavedMails", " Wnlk Comment (" + checkProcessActive(winlinkCommentState) + ")" , lastLine);
break; break;
case 53: // 5.Winlink case 53: // 5.Winlink
show_display("_WINLINK_>", " Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", "> Quick Check" , lastLine); show_display("_WINLINK_>", " Login" , " Read SavedMails(" + String(MSG_Utils::getNumWLNKMails()) + ")", " Delete SavedMails", "> Wnlk Comment (" + checkProcessActive(winlinkCommentState) + ")" , lastLine);
break; break;
case 500: // 5.Winlink ---> Login case 500: // 5.Winlink ---> Login

View File

@ -245,7 +245,7 @@ namespace MSG_Utils {
void processOutputBuffer() { void processOutputBuffer() {
uint32_t lastOutputBufferTx = millis() - ackTime; uint32_t lastOutputBufferTx = millis() - ackTime;
if (!outputBufferPackets.empty() && lastOutputBufferTx >= 4200) { if (!outputBufferPackets.empty() && lastOutputBufferTx >= 4500) {
sendMessage(0, outputBufferPackets[0].substring(0, outputBufferPackets[0].indexOf(",")), outputBufferPackets[0].substring(outputBufferPackets[0].indexOf(",") + 1)); sendMessage(0, outputBufferPackets[0].substring(0, outputBufferPackets[0].indexOf(",")), outputBufferPackets[0].substring(outputBufferPackets[0].indexOf(",") + 1));
outputBufferPackets.pop_front(); outputBufferPackets.pop_front();
ackTime = millis(); ackTime = millis();
@ -261,7 +261,6 @@ namespace MSG_Utils {
lastReceivedPacket = APRSPacketLib::processReceivedPacket(packet.text.substring(3),packet.rssi, packet.snr, packet.freqError); lastReceivedPacket = APRSPacketLib::processReceivedPacket(packet.text.substring(3),packet.rssi, packet.snr, packet.freqError);
if (lastReceivedPacket.sender!=currentBeacon->callsign) { if (lastReceivedPacket.sender!=currentBeacon->callsign) {
if (lastReceivedPacket.sender != "WLNK-1") {
if (Config.bluetoothType == 0) { if (Config.bluetoothType == 0) {
BLE_Utils::sendToPhone(packet.text.substring(3)); BLE_Utils::sendToPhone(packet.text.substring(3));
} else { } else {
@ -269,7 +268,6 @@ namespace MSG_Utils {
BLUETOOTH_Utils::sendPacket(packet.text.substring(3)); BLUETOOTH_Utils::sendPacket(packet.text.substring(3));
#endif #endif
} }
}
if (digirepeaterActive && lastReceivedPacket.addressee!=currentBeacon->callsign) { if (digirepeaterActive && lastReceivedPacket.addressee!=currentBeacon->callsign) {
String digiRepeatedPacket = APRSPacketLib::generateDigiRepeatedPacket(lastReceivedPacket, currentBeacon->callsign); String digiRepeatedPacket = APRSPacketLib::generateDigiRepeatedPacket(lastReceivedPacket, currentBeacon->callsign);

View File

@ -41,6 +41,7 @@ extern double lastTxDistance;
extern bool miceActive; extern bool miceActive;
extern bool smartBeaconValue; extern bool smartBeaconValue;
extern uint8_t winlinkStatus; extern uint8_t winlinkStatus;
extern bool winlinkCommentState;
String firstNearTracker; String firstNearTracker;
String secondNearTracker; String secondNearTracker;
@ -386,7 +387,8 @@ namespace STATION_Utils {
} }
void sendBeacon(String type) { void sendBeacon(String type) {
String packet; String packet, comment;
int sendCommentAfterXBeacons;
if (Config.bme.sendTelemetry && type == "Wx") { if (Config.bme.sendTelemetry && type == "Wx") {
if (miceActive) { if (miceActive) {
packet = APRSPacketLib::generateMiceGPSBeacon(currentBeacon->micE, currentBeacon->callsign,"_", currentBeacon->overlay, Config.path, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters()); packet = APRSPacketLib::generateMiceGPSBeacon(currentBeacon->micE, currentBeacon->callsign,"_", currentBeacon->overlay, Config.path, gps.location.lat(), gps.location.lng(), gps.course.deg(), gps.speed.knots(), gps.altitude.meters());
@ -401,10 +403,17 @@ namespace STATION_Utils {
packet = APRSPacketLib::generateGPSBeaconPacket(currentBeacon->callsign, "APLRT1", Config.path, currentBeacon->overlay, APRSPacketLib::encodeGPS(gps.location.lat(),gps.location.lng(), gps.course.deg(), gps.speed.knots(), currentBeacon->symbol, Config.sendAltitude, gps.altitude.feet(), sendStandingUpdate, "GPS")); packet = APRSPacketLib::generateGPSBeaconPacket(currentBeacon->callsign, "APLRT1", Config.path, currentBeacon->overlay, APRSPacketLib::encodeGPS(gps.location.lat(),gps.location.lng(), gps.course.deg(), gps.speed.knots(), currentBeacon->symbol, Config.sendAltitude, gps.altitude.feet(), sendStandingUpdate, "GPS"));
} }
} }
if (currentBeacon->comment != "") { if (winlinkCommentState) {
comment = " winlink";
sendCommentAfterXBeacons = 1;
} else {
sendCommentAfterXBeacons = Config.sendCommentAfterXBeacons;
comment = currentBeacon->comment;
}
if (comment != "") {
updateCounter++; updateCounter++;
if (updateCounter >= Config.sendCommentAfterXBeacons) { if (updateCounter >= sendCommentAfterXBeacons) {
packet += currentBeacon->comment; packet += comment;
updateCounter = 0; updateCounter = 0;
} }
} }

View File

@ -16,11 +16,15 @@ namespace WINLINK_Utils {
for (int i = 0; i < winlinkInteger.length(); i++) { for (int i = 0; i < winlinkInteger.length(); i++) {
String number = String(winlinkInteger[i]); String number = String(winlinkInteger[i]);
int digit = number.toInt(); int digit = number.toInt();
if (digit > Config.winlink.password.length()) {
show_display("__WINLINK_", "" , "PASS Length<REQUIRED", "", "" , "", 2000);
challengeAnswer += Config.winlink.password[0];
} else {
challengeAnswer += Config.winlink.password[digit - 1]; challengeAnswer += Config.winlink.password[digit - 1];
} }
}
challengeAnswer += "AZ6"; challengeAnswer += "AZ6";
delay(500); delay(500);
//Serial.println("el challenge creado es " + challengeAnswer);
MSG_Utils::sendMessage(1, "WLNK-1", challengeAnswer); MSG_Utils::sendMessage(1, "WLNK-1", challengeAnswer);
} }