diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 9ca7ef3..060fa81 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -127,6 +127,7 @@ String winlinkSubject = ""; String winlinkBody = ""; String winlinkAlias = ""; String winlinkAliasComplete = ""; +bool winlinkCommentState = false; APRSPacket lastReceivedPacket; diff --git a/src/keyboard_utils.cpp b/src/keyboard_utils.cpp index fbadef6..eeae1df 100644 --- a/src/keyboard_utils.cpp +++ b/src/keyboard_utils.cpp @@ -53,6 +53,7 @@ extern String winlinkSubject; extern String winlinkBody; extern String winlinkAlias; extern String winlinkAliasComplete; +extern bool winlinkCommentState; bool mouseUpState = 0; bool mouseDownState = 0; @@ -410,13 +411,12 @@ namespace KEYBOARD_Utils { } else if (menuDisplay == 52) { menuDisplay = 50111; } else if (menuDisplay == 53) { - if (gps.location.lat() != 0.0) { - 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")); - packet += "winlink"; - show_display("<<< TX >>>", "", packet,100); - LoRa_Utils::sendNewPacket(packet); + if (winlinkCommentState) { + winlinkCommentState = false; + show_display("_WINLINK_>", "", " WLNK COMMENTs OFF!", 2000); } else { - show_display("___INFO___", "", " WAITING FOR GPS FIX", 2000); + winlinkCommentState = true; + show_display("_WINLINK_>", "", " WLNK COMMENTs ON!", 2000); } } else if (menuDisplay == 5000) { MSG_Utils::sendMessage(1, "WLNK-1", "L"); diff --git a/src/menu_utils.cpp b/src/menu_utils.cpp index 503b6a1..ecc3fe9 100644 --- a/src/menu_utils.cpp +++ b/src/menu_utils.cpp @@ -42,6 +42,7 @@ extern String winlinkSubject; extern String winlinkBody; extern String winlinkAlias; extern String winlinkAliasComplete; +extern bool winlinkCommentState; String freqChangeWarning; @@ -185,10 +186,10 @@ namespace MENU_Utils { show_display("_CONFIG___", " Power Off", "> Change Callsign ", " Change Frequency", " Display",lastLine); break; case 21: // 2.Configuration ---> Change Freq - show_display("_CONFIG___", " Change Callsign ", "> Change Frequency", " Display", " " + checkBTType() + " ("+ checkProcessActive(bluetoothActive) + ")",lastLine); + show_display("_CONFIG___", " Change Callsign ", "> Change Frequency", " Display", " " + checkBTType() + " (" + checkProcessActive(bluetoothActive) + ")",lastLine); break; case 22: // 2.Configuration ---> Display - show_display("_CONFIG___", " Change Frequency", "> Display", " " + checkBTType() + " ("+ checkProcessActive(bluetoothActive) + ")", " Status",lastLine); + show_display("_CONFIG___", " Change Frequency", "> Display", " " + checkBTType() + " (" + checkProcessActive(bluetoothActive) + ")", " Status",lastLine); break; case 23: // 2.Configuration ---> Bluetooth show_display("_CONFIG___", " Display", "> " + checkBTType() + " (" + checkProcessActive(bluetoothActive) + ")", " Status", " Notifications", lastLine); @@ -335,17 +336,17 @@ namespace MENU_Utils { if (winlinkStatus == 5) { menuDisplay = 5000; } 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; 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; 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; 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; case 500: // 5.Winlink ---> Login diff --git a/src/msg_utils.cpp b/src/msg_utils.cpp index 3c686fe..55756ed 100644 --- a/src/msg_utils.cpp +++ b/src/msg_utils.cpp @@ -245,7 +245,7 @@ namespace MSG_Utils { void processOutputBuffer() { 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)); outputBufferPackets.pop_front(); ackTime = millis(); @@ -261,14 +261,12 @@ namespace MSG_Utils { lastReceivedPacket = APRSPacketLib::processReceivedPacket(packet.text.substring(3),packet.rssi, packet.snr, packet.freqError); if (lastReceivedPacket.sender!=currentBeacon->callsign) { - if (lastReceivedPacket.sender != "WLNK-1") { - if (Config.bluetoothType == 0) { - BLE_Utils::sendToPhone(packet.text.substring(3)); - } else { - #ifdef HAS_BT_CLASSIC - BLUETOOTH_Utils::sendPacket(packet.text.substring(3)); - #endif - } + if (Config.bluetoothType == 0) { + BLE_Utils::sendToPhone(packet.text.substring(3)); + } else { + #ifdef HAS_BT_CLASSIC + BLUETOOTH_Utils::sendPacket(packet.text.substring(3)); + #endif } if (digirepeaterActive && lastReceivedPacket.addressee!=currentBeacon->callsign) { diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 3d9a9e2..d4043e2 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -41,6 +41,7 @@ extern double lastTxDistance; extern bool miceActive; extern bool smartBeaconValue; extern uint8_t winlinkStatus; +extern bool winlinkCommentState; String firstNearTracker; String secondNearTracker; @@ -386,7 +387,8 @@ namespace STATION_Utils { } void sendBeacon(String type) { - String packet; + String packet, comment; + int sendCommentAfterXBeacons; if (Config.bme.sendTelemetry && type == "Wx") { 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()); @@ -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")); } } - if (currentBeacon->comment != "") { + if (winlinkCommentState) { + comment = " winlink"; + sendCommentAfterXBeacons = 1; + } else { + sendCommentAfterXBeacons = Config.sendCommentAfterXBeacons; + comment = currentBeacon->comment; + } + if (comment != "") { updateCounter++; - if (updateCounter >= Config.sendCommentAfterXBeacons) { - packet += currentBeacon->comment; + if (updateCounter >= sendCommentAfterXBeacons) { + packet += comment; updateCounter = 0; } } diff --git a/src/winlink_utils.cpp b/src/winlink_utils.cpp index 1413eff..22692b0 100644 --- a/src/winlink_utils.cpp +++ b/src/winlink_utils.cpp @@ -16,11 +16,15 @@ namespace WINLINK_Utils { for (int i = 0; i < winlinkInteger.length(); i++) { String number = String(winlinkInteger[i]); int digit = number.toInt(); - challengeAnswer += Config.winlink.password[digit - 1]; + if (digit > Config.winlink.password.length()) { + show_display("__WINLINK_", "" , "PASS Length