ready for first test
This commit is contained in:
parent
e6be27ce54
commit
aff0b01c3e
|
|
@ -115,7 +115,7 @@
|
||||||
"reverse": false
|
"reverse": false
|
||||||
},
|
},
|
||||||
"wifiAP": {
|
"wifiAP": {
|
||||||
"active": true,
|
"active": false,
|
||||||
"password": "1234567890"
|
"password": "1234567890"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ namespace BUTTON_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
void multiPress() {
|
void multiPress() {
|
||||||
POWER_Utils::shutdown();
|
displayToggle(true);
|
||||||
|
menuTime = millis();
|
||||||
|
menuDisplay = 9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -84,77 +84,52 @@ namespace KEYBOARD_Utils {
|
||||||
void upArrow() {
|
void upArrow() {
|
||||||
if (menuDisplay >= 1 && menuDisplay <= 6) {
|
if (menuDisplay >= 1 && menuDisplay <= 6) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 1) {
|
if (menuDisplay < 1) menuDisplay = 6;
|
||||||
menuDisplay = 6;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 10 && menuDisplay <= 13) {
|
} else if (menuDisplay >= 10 && menuDisplay <= 13) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 10) {
|
if (menuDisplay < 10) menuDisplay = 13;
|
||||||
menuDisplay = 13;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 130 && menuDisplay <= 133) {
|
} else if (menuDisplay >= 130 && menuDisplay <= 133) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 130) {
|
if (menuDisplay < 130) menuDisplay = 133;
|
||||||
menuDisplay = 133;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay >= 20 && menuDisplay <= 27) {
|
else if (menuDisplay >= 20 && menuDisplay <= 27) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 20) {
|
if (menuDisplay < 20) menuDisplay = 27;
|
||||||
menuDisplay = 27;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 220 && menuDisplay <= 221) {
|
} else if (menuDisplay >= 220 && menuDisplay <= 221) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 220) {
|
if (menuDisplay < 220) menuDisplay = 221;
|
||||||
menuDisplay = 221;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 240 && menuDisplay <= 241) {
|
} else if (menuDisplay >= 240 && menuDisplay <= 241) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 240) {
|
if (menuDisplay < 240) menuDisplay = 241;
|
||||||
menuDisplay = 241;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay >= 30 && menuDisplay <= 31) {
|
else if (menuDisplay >= 30 && menuDisplay <= 31) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 30) {
|
if (menuDisplay < 30) menuDisplay = 31;
|
||||||
menuDisplay = 31;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay >= 50 && menuDisplay <= 53) {
|
else if (menuDisplay >= 50 && menuDisplay <= 53) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 50) {
|
if (menuDisplay < 50) menuDisplay = 53;
|
||||||
menuDisplay = 53;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 5000 || menuDisplay == 5010 || menuDisplay == 5020 || menuDisplay == 5030 || menuDisplay == 5040 || menuDisplay == 5050 || menuDisplay == 5060 || menuDisplay == 5070 || menuDisplay == 5080) {
|
} else if (menuDisplay == 5000 || menuDisplay == 5010 || menuDisplay == 5020 || menuDisplay == 5030 || menuDisplay == 5040 || menuDisplay == 5050 || menuDisplay == 5060 || menuDisplay == 5070 || menuDisplay == 5080) {
|
||||||
menuDisplay = menuDisplay - 10;
|
menuDisplay = menuDisplay - 10;
|
||||||
if (menuDisplay < 5000) {
|
if (menuDisplay < 5000) menuDisplay = 5080;
|
||||||
menuDisplay = 5080;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 50100 || menuDisplay == 50110) {
|
} else if (menuDisplay == 50100 || menuDisplay == 50110) {
|
||||||
menuDisplay = menuDisplay - 10;
|
menuDisplay = menuDisplay - 10;
|
||||||
if (menuDisplay < 50100) {
|
if (menuDisplay < 50100) menuDisplay = 50110;
|
||||||
menuDisplay = 50110;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 5061 && menuDisplay <= 5063) {
|
} else if (menuDisplay >= 5061 && menuDisplay <= 5063) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 5061) {
|
if (menuDisplay < 5061) menuDisplay = 5063;
|
||||||
menuDisplay = 5063;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 5084 && menuDisplay <= 5085) {
|
} else if (menuDisplay >= 5084 && menuDisplay <= 5085) {
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 5084) {
|
if (menuDisplay < 5084) menuDisplay = 5085;
|
||||||
menuDisplay = 5085;
|
} else if (menuDisplay >= 60 && menuDisplay <= 63) {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (menuDisplay >= 60 && menuDisplay <= 63) {
|
|
||||||
menuDisplay--;
|
menuDisplay--;
|
||||||
if (menuDisplay < 60) {
|
if (menuDisplay < 60) menuDisplay = 63;
|
||||||
menuDisplay = 63;
|
} else if (menuDisplay >= 9000 && menuDisplay <= 9001) {
|
||||||
}
|
menuDisplay--;
|
||||||
|
if (menuDisplay < 9000) menuDisplay = 9001;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,28 +146,20 @@ namespace KEYBOARD_Utils {
|
||||||
}
|
}
|
||||||
if (menuDisplay >= 1 && menuDisplay <= 6) {
|
if (menuDisplay >= 1 && menuDisplay <= 6) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 6) {
|
if (menuDisplay > 6) menuDisplay = 1;
|
||||||
menuDisplay = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (menuDisplay >= 10 && menuDisplay <= 13) {
|
else if (menuDisplay >= 10 && menuDisplay <= 13) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 13) {
|
if (menuDisplay > 13) menuDisplay = 10;
|
||||||
menuDisplay = 10;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 130 && menuDisplay <= 133) {
|
} else if (menuDisplay >= 130 && menuDisplay <= 133) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 133) {
|
if (menuDisplay > 133) menuDisplay = 130;
|
||||||
menuDisplay = 130;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 100) {
|
} else if (menuDisplay == 100) {
|
||||||
messagesIterator++;
|
messagesIterator++;
|
||||||
if (messagesIterator == MSG_Utils::getNumAPRSMessages()) {
|
if (messagesIterator == MSG_Utils::getNumAPRSMessages()) {
|
||||||
menuDisplay = 10;
|
menuDisplay = 10;
|
||||||
messagesIterator = 0;
|
messagesIterator = 0;
|
||||||
if (Config.notification.ledMessage) {
|
if (Config.notification.ledMessage) messageLed = false;
|
||||||
messageLed = false;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
menuDisplay = 100;
|
menuDisplay = 100;
|
||||||
}
|
}
|
||||||
|
|
@ -202,26 +169,18 @@ namespace KEYBOARD_Utils {
|
||||||
|
|
||||||
else if (menuDisplay >= 20 && menuDisplay <= 27) {
|
else if (menuDisplay >= 20 && menuDisplay <= 27) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 27) {
|
if (menuDisplay > 27) menuDisplay = 20;
|
||||||
menuDisplay = 20;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 220 && menuDisplay <= 221) {
|
} else if (menuDisplay >= 220 && menuDisplay <= 221) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 221) {
|
if (menuDisplay > 221) menuDisplay = 220;
|
||||||
menuDisplay = 220;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 240 && menuDisplay <= 241) {
|
} else if (menuDisplay >= 240 && menuDisplay <= 241) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 241) {
|
if (menuDisplay > 241) menuDisplay = 240;
|
||||||
menuDisplay = 240;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay >= 30 && menuDisplay <= 31) {
|
else if (menuDisplay >= 30 && menuDisplay <= 31) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 31) {
|
if (menuDisplay > 31) menuDisplay = 30;
|
||||||
menuDisplay = 30;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay == 40) {
|
else if (menuDisplay == 40) {
|
||||||
|
|
@ -230,19 +189,13 @@ namespace KEYBOARD_Utils {
|
||||||
|
|
||||||
else if (menuDisplay >= 50 && menuDisplay <= 53) {
|
else if (menuDisplay >= 50 && menuDisplay <= 53) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 53) {
|
if (menuDisplay > 53) menuDisplay = 50;
|
||||||
menuDisplay = 50;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 5000 || menuDisplay == 5010 || menuDisplay == 5020 || menuDisplay == 5030 || menuDisplay == 5040 || menuDisplay == 5050 || menuDisplay == 5060 || menuDisplay == 5070 || menuDisplay == 5080) {
|
} else if (menuDisplay == 5000 || menuDisplay == 5010 || menuDisplay == 5020 || menuDisplay == 5030 || menuDisplay == 5040 || menuDisplay == 5050 || menuDisplay == 5060 || menuDisplay == 5070 || menuDisplay == 5080) {
|
||||||
menuDisplay = menuDisplay + 10;
|
menuDisplay = menuDisplay + 10;
|
||||||
if (menuDisplay > 5080) {
|
if (menuDisplay > 5080) menuDisplay = 5000;
|
||||||
menuDisplay = 5000;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 50100 || menuDisplay == 50110) {
|
} else if (menuDisplay == 50100 || menuDisplay == 50110) {
|
||||||
menuDisplay = menuDisplay + 10;
|
menuDisplay = menuDisplay + 10;
|
||||||
if (menuDisplay > 50110) {
|
if (menuDisplay > 50110) menuDisplay = 50100;
|
||||||
menuDisplay = 50100;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay == 50101) {
|
} else if (menuDisplay == 50101) {
|
||||||
messagesIterator++;
|
messagesIterator++;
|
||||||
if (messagesIterator == MSG_Utils::getNumWLNKMails()) {
|
if (messagesIterator == MSG_Utils::getNumWLNKMails()) {
|
||||||
|
|
@ -252,29 +205,26 @@ namespace KEYBOARD_Utils {
|
||||||
menuDisplay = 50100;
|
menuDisplay = 50100;
|
||||||
}
|
}
|
||||||
messagesIterator = 0;
|
messagesIterator = 0;
|
||||||
if (Config.notification.ledMessage) {
|
if (Config.notification.ledMessage) messageLed = false;
|
||||||
messageLed = false;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
menuDisplay = 50101;
|
menuDisplay = 50101;
|
||||||
}
|
}
|
||||||
} else if (menuDisplay >= 5061 && menuDisplay <= 5063) {
|
} else if (menuDisplay >= 5061 && menuDisplay <= 5063) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 5063) {
|
if (menuDisplay > 5063) menuDisplay = 5061;
|
||||||
menuDisplay = 5061;
|
|
||||||
}
|
|
||||||
} else if (menuDisplay >= 5084 && menuDisplay <= 5085) {
|
} else if (menuDisplay >= 5084 && menuDisplay <= 5085) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 5085) {
|
if (menuDisplay > 5085) menuDisplay = 5084;
|
||||||
menuDisplay = 5084;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (menuDisplay >= 60 && menuDisplay <= 63) {
|
else if (menuDisplay >= 60 && menuDisplay <= 63) {
|
||||||
menuDisplay++;
|
menuDisplay++;
|
||||||
if (menuDisplay > 63) {
|
if (menuDisplay > 63) menuDisplay = 60;
|
||||||
menuDisplay = 60;
|
}
|
||||||
}
|
|
||||||
|
else if (menuDisplay >= 9000 && menuDisplay <= 9001) {
|
||||||
|
menuDisplay++;
|
||||||
|
if (menuDisplay > 9001) menuDisplay = 9000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -337,9 +287,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkCommentState = false;
|
winlinkCommentState = false;
|
||||||
displayShow("__ INFO __", "", " CHANGING CALLSIGN!", "", "-----> " + Config.beacons[myBeaconsIndex].callsign, "", 2000);
|
displayShow("__ INFO __", "", " CHANGING CALLSIGN!", "", "-----> " + Config.beacons[myBeaconsIndex].callsign, "", 2000);
|
||||||
STATION_Utils::saveIndex(0, myBeaconsIndex);
|
STATION_Utils::saveIndex(0, myBeaconsIndex);
|
||||||
if (menuDisplay == 200) {
|
if (menuDisplay == 200) menuDisplay = 20;
|
||||||
menuDisplay = 20;
|
|
||||||
}
|
|
||||||
} else if ((menuDisplay >= 1 && menuDisplay <= 3) || (menuDisplay >= 11 &&menuDisplay <= 13) || (menuDisplay >= 20 && menuDisplay <= 27) || (menuDisplay >= 30 && menuDisplay <= 31)) {
|
} else if ((menuDisplay >= 1 && menuDisplay <= 3) || (menuDisplay >= 11 &&menuDisplay <= 13) || (menuDisplay >= 20 && menuDisplay <= 27) || (menuDisplay >= 30 && menuDisplay <= 31)) {
|
||||||
menuDisplay = menuDisplay * 10;
|
menuDisplay = menuDisplay * 10;
|
||||||
} else if (menuDisplay == 10) {
|
} else if (menuDisplay == 10) {
|
||||||
|
|
@ -524,6 +472,25 @@ namespace KEYBOARD_Utils {
|
||||||
} else if (menuDisplay == 63) {
|
} else if (menuDisplay == 63) {
|
||||||
menuDisplay = 630;
|
menuDisplay = 630;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (menuDisplay == 9000) {
|
||||||
|
if (Config.wifiAP.active) {
|
||||||
|
displayShow("_WiFI AP_", "WiFi AP is ON", " check 192.168.4.1...", 2000);
|
||||||
|
} else {
|
||||||
|
displayShow("", "", " STARTING WiFi AP...", 2000);
|
||||||
|
Config.wifiAP.active = true;
|
||||||
|
// save all config file!
|
||||||
|
// restart
|
||||||
|
|
||||||
|
}
|
||||||
|
} else if (menuDisplay == 9001) {
|
||||||
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
|
displayShow("", "", " POWER OFF ...", 2000);
|
||||||
|
#else
|
||||||
|
displayShow("", "", " starting DEEP SLEEP", 2000);
|
||||||
|
#endif
|
||||||
|
POWER_Utils::shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void processPressedKey(char key) {
|
void processPressedKey(char key) {
|
||||||
|
|
@ -553,31 +520,23 @@ namespace KEYBOARD_Utils {
|
||||||
} else if (menuDisplay >= 1 && menuDisplay <= 6 && key >=49 && key <= 55) { // Menu number select
|
} else if (menuDisplay >= 1 && menuDisplay <= 6 && key >=49 && key <= 55) { // Menu number select
|
||||||
menuDisplay = key - 48;
|
menuDisplay = key - 48;
|
||||||
} else if (menuDisplay == 110 && key != 180) { // Writing Callsign of Message
|
} else if (menuDisplay == 110 && key != 180) { // Writing Callsign of Message
|
||||||
if (messageCallsign.length() == 1) {
|
if (messageCallsign.length() == 1) messageCallsign.trim();
|
||||||
messageCallsign.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 45) { //only letters + numbers + "-"
|
if ((key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122) || key == 45) { //only letters + numbers + "-"
|
||||||
messageCallsign += key;
|
messageCallsign += key;
|
||||||
} else if (key == 13) { // Return Pressed
|
} else if (key == 13) { // Return Pressed
|
||||||
messageCallsign.trim();
|
messageCallsign.trim();
|
||||||
if (menuDisplay == 110) {
|
if (menuDisplay == 110) menuDisplay = 111;
|
||||||
menuDisplay = 111;
|
|
||||||
}
|
|
||||||
} else if (key == 8) { // Delete Last Key
|
} else if (key == 8) { // Delete Last Key
|
||||||
messageCallsign = messageCallsign.substring(0, messageCallsign.length() - 1);
|
messageCallsign = messageCallsign.substring(0, messageCallsign.length() - 1);
|
||||||
}
|
}
|
||||||
messageCallsign.toUpperCase();
|
messageCallsign.toUpperCase();
|
||||||
} else if ((menuDisplay == 111 || menuDisplay == 1300 || menuDisplay == 1310) && key!= 180) { // Writting Text of Message
|
} else if ((menuDisplay == 111 || menuDisplay == 1300 || menuDisplay == 1310) && key!= 180) { // Writting Text of Message
|
||||||
if (messageText.length() == 1) {
|
if (messageText.length() == 1) messageText.trim();
|
||||||
messageText.trim();
|
|
||||||
}
|
|
||||||
if (key >= 32 && key <= 126) {
|
if (key >= 32 && key <= 126) {
|
||||||
messageText += key;
|
messageText += key;
|
||||||
} else if (key == 13 && messageText.length() > 0) { // Return Pressed: SENDING MESSAGE
|
} else if (key == 13 && messageText.length() > 0) { // Return Pressed: SENDING MESSAGE
|
||||||
messageText.trim();
|
messageText.trim();
|
||||||
if (messageText.length() > 67) {
|
if (messageText.length() > 67) messageText = messageText.substring(0, 67);
|
||||||
messageText = messageText.substring(0, 67);
|
|
||||||
}
|
|
||||||
if (menuDisplay == 111) {
|
if (menuDisplay == 111) {
|
||||||
MSG_Utils::addToOutputBuffer(0, messageCallsign, messageText);
|
MSG_Utils::addToOutputBuffer(0, messageCallsign, messageText);
|
||||||
menuDisplay = 11;
|
menuDisplay = 11;
|
||||||
|
|
@ -600,11 +559,11 @@ namespace KEYBOARD_Utils {
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
} else if (menuDisplay == 270 && key == 13) {
|
} else if (menuDisplay == 270 && key == 13) {
|
||||||
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
|
||||||
displayShow("", "", " POWER OFF ...", 2000);
|
displayShow("", "", " POWER OFF ...", 2000);
|
||||||
POWER_Utils::shutdown();
|
|
||||||
#else
|
#else
|
||||||
displayShow("", "", "ESP32 CAN'T POWER OFF", 2000);
|
displayShow("", "", " starting DEEP SLEEP", 2000);
|
||||||
#endif
|
#endif
|
||||||
|
POWER_Utils::shutdown();
|
||||||
} else if ((menuDisplay == 5021 || menuDisplay == 5031 || menuDisplay == 5041 || menuDisplay == 5051) && key >= 48 && key <= 57) {
|
} else if ((menuDisplay == 5021 || menuDisplay == 5031 || menuDisplay == 5041 || menuDisplay == 5051) && key >= 48 && key <= 57) {
|
||||||
winlinkMailNumber = key;
|
winlinkMailNumber = key;
|
||||||
} else if ((menuDisplay == 5021 || menuDisplay == 5031 || menuDisplay == 5041 || menuDisplay == 5051) && key == 8) {
|
} else if ((menuDisplay == 5021 || menuDisplay == 5031 || menuDisplay == 5041 || menuDisplay == 5051) && key == 8) {
|
||||||
|
|
@ -620,9 +579,7 @@ namespace KEYBOARD_Utils {
|
||||||
} else if (menuDisplay == 5041 && key == 13 && winlinkMailNumber != "_?") {
|
} else if (menuDisplay == 5041 && key == 13 && winlinkMailNumber != "_?") {
|
||||||
menuDisplay = 5042;
|
menuDisplay = 5042;
|
||||||
} else if (menuDisplay == 5042) {
|
} else if (menuDisplay == 5042) {
|
||||||
if (winlinkAddressee.length() == 1) {
|
if (winlinkAddressee.length() == 1) winlinkAddressee.trim();
|
||||||
winlinkAddressee.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
||||||
winlinkAddressee += key;
|
winlinkAddressee += key;
|
||||||
} else if (key == 13 && winlinkAddressee.length() > 0) {
|
} else if (key == 13 && winlinkAddressee.length() > 0) {
|
||||||
|
|
@ -642,9 +599,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkMailNumber = "_?";
|
winlinkMailNumber = "_?";
|
||||||
menuDisplay = 5050;
|
menuDisplay = 5050;
|
||||||
} else if (menuDisplay == 50610) {
|
} else if (menuDisplay == 50610) {
|
||||||
if (winlinkAlias.length() == 1) {
|
if (winlinkAlias.length() == 1) winlinkAlias.trim();
|
||||||
winlinkAlias.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57)) {
|
||||||
winlinkAlias += key;
|
winlinkAlias += key;
|
||||||
} else if (key == 13 && winlinkAlias.length()>= 1) {
|
} else if (key == 13 && winlinkAlias.length()>= 1) {
|
||||||
|
|
@ -657,9 +612,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkAlias = "";
|
winlinkAlias = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 50611) {
|
} else if (menuDisplay == 50611) {
|
||||||
if (winlinkAliasComplete.length() == 1) {
|
if (winlinkAliasComplete.length() == 1) winlinkAliasComplete.trim();
|
||||||
winlinkAliasComplete.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
||||||
winlinkAliasComplete += key;
|
winlinkAliasComplete += key;
|
||||||
} else if (key == 13 && winlinkAliasComplete.length()>= 1) {
|
} else if (key == 13 && winlinkAliasComplete.length()>= 1) {
|
||||||
|
|
@ -675,9 +628,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkAliasComplete = "";
|
winlinkAliasComplete = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 50620) {
|
} else if (menuDisplay == 50620) {
|
||||||
if (winlinkAlias.length() == 1) {
|
if (winlinkAlias.length() == 1) winlinkAlias.trim();
|
||||||
winlinkAlias.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57)) {
|
||||||
winlinkAlias += key;
|
winlinkAlias += key;
|
||||||
} else if (key == 13 && winlinkAlias.length()>= 1) {
|
} else if (key == 13 && winlinkAlias.length()>= 1) {
|
||||||
|
|
@ -692,9 +643,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkAlias = "";
|
winlinkAlias = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 5081) {
|
} else if (menuDisplay == 5081) {
|
||||||
if (winlinkAddressee.length() == 1) {
|
if (winlinkAddressee.length() == 1) winlinkAddressee.trim();
|
||||||
winlinkAddressee.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key >= 48 && key <= 57) || (key == 45) || (key == 46) || (key == 64) || (key == 95)) {
|
||||||
winlinkAddressee += key;
|
winlinkAddressee += key;
|
||||||
} else if (key == 13 && winlinkAddressee.length() > 0) {
|
} else if (key == 13 && winlinkAddressee.length() > 0) {
|
||||||
|
|
@ -707,9 +656,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkAddressee = "";
|
winlinkAddressee = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 5082) {
|
} else if (menuDisplay == 5082) {
|
||||||
if (winlinkSubject.length() == 1) {
|
if (winlinkSubject.length() == 1) winlinkSubject.trim();
|
||||||
winlinkSubject.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key == 32) || (key >= 48 && key <= 57)) {
|
if ((key >= 65 && key <=90) || (key >= 97 && key <= 122) || (key == 32) || (key >= 48 && key <= 57)) {
|
||||||
winlinkSubject += key;
|
winlinkSubject += key;
|
||||||
} else if (key == 13 && winlinkSubject.length() > 0) {
|
} else if (key == 13 && winlinkSubject.length() > 0) {
|
||||||
|
|
@ -723,9 +670,7 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkSubject = "";
|
winlinkSubject = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 5083) {
|
} else if (menuDisplay == 5083) {
|
||||||
if (winlinkBody.length() == 1) {
|
if (winlinkBody.length() == 1) winlinkBody.trim();
|
||||||
winlinkBody.trim();
|
|
||||||
}
|
|
||||||
if ((key >= 32 && key <=122)) {
|
if ((key >= 32 && key <=122)) {
|
||||||
winlinkBody += key;
|
winlinkBody += key;
|
||||||
} else if (key == 13 && winlinkBody.length() <= 67) {
|
} else if (key == 13 && winlinkBody.length() <= 67) {
|
||||||
|
|
@ -738,16 +683,12 @@ namespace KEYBOARD_Utils {
|
||||||
winlinkBody = "";
|
winlinkBody = "";
|
||||||
}
|
}
|
||||||
} else if (menuDisplay == 630 && key != 180) {
|
} else if (menuDisplay == 630 && key != 180) {
|
||||||
if (messageText.length() == 1) {
|
if (messageText.length() == 1) messageText.trim();
|
||||||
messageText.trim();
|
|
||||||
}
|
|
||||||
if (key >= 32 && key <= 126) {
|
if (key >= 32 && key <= 126) {
|
||||||
messageText += key;
|
messageText += key;
|
||||||
} else if (key == 13 && messageText.length() > 0) {
|
} else if (key == 13 && messageText.length() > 0) {
|
||||||
messageText.trim();
|
messageText.trim();
|
||||||
if (messageText.length() > 67) {
|
if (messageText.length() > 67) messageText = messageText.substring(0, 67);
|
||||||
messageText = messageText.substring(0, 67);
|
|
||||||
}
|
|
||||||
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"));
|
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 += messageText;
|
packet += messageText;
|
||||||
displayShow("<<< TX >>>", "", packet,100);
|
displayShow("<<< TX >>>", "", packet,100);
|
||||||
|
|
@ -833,16 +774,12 @@ namespace KEYBOARD_Utils {
|
||||||
void read() {
|
void read() {
|
||||||
if (keyboardConnected) {
|
if (keyboardConnected) {
|
||||||
uint32_t lastKey = millis() - keyboardTime;
|
uint32_t lastKey = millis() - keyboardTime;
|
||||||
if (lastKey > 30*1000) {
|
if (lastKey > 30 * 1000) keyDetected = false;
|
||||||
keyDetected = false;
|
|
||||||
}
|
|
||||||
Wire.requestFrom(KB_ADDR, 1);
|
Wire.requestFrom(KB_ADDR, 1);
|
||||||
while(Wire.available()) {
|
while(Wire.available()) {
|
||||||
char c = Wire.read();
|
char c = Wire.read();
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
// just for debugging
|
//Serial.print(c, DEC); Serial.print(" "); Serial.print(c, HEX); Serial.print(" "); Serial.println(char(c)); // just for debugging
|
||||||
//Serial.print(c, DEC); Serial.print(" "); Serial.print(c, HEX); Serial.print(" "); Serial.println(char(c));
|
|
||||||
|
|
||||||
keyboardTime = millis();
|
keyboardTime = millis();
|
||||||
processPressedKey(c);
|
processPressedKey(c);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -504,6 +504,15 @@ namespace MENU_Utils {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//////////
|
||||||
|
case 9000: // 9. multiPress Menu ---> Turn ON WiFi AP
|
||||||
|
displayShow("__CONFIG__", "> Turn ON WiFi AP", " Turn Tracker Off", "","",lastLine);
|
||||||
|
break;
|
||||||
|
case 9001: // 9. multiPress Menu
|
||||||
|
displayShow("__CONFIG__", " Turn ON WiFi AP", "> Turn Tracker Off", "","",lastLine);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
case 0: ///////////// MAIN MENU //////////////
|
case 0: ///////////// MAIN MENU //////////////
|
||||||
String hdopState, firstRowMainMenu, secondRowMainMenu, thirdRowMainMenu, fourthRowMainMenu, fifthRowMainMenu, sixthRowMainMenu;
|
String hdopState, firstRowMainMenu, secondRowMainMenu, thirdRowMainMenu, fourthRowMainMenu, fifthRowMainMenu, sixthRowMainMenu;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue