Skip to content

Commit 53dfe64

Browse files
committed
Version jPskmail-3.1.8.5-20240105-Beta (unpublished)
- Allow for unmodified Fldigi to pass-on messages despite limited control character set for Olivia and MT63 modes (characters must be > ASCII 7). Replaced SOH/EOT by DC1/DC3.
1 parent 9f7641a commit 53dfe64

4 files changed

Lines changed: 89 additions & 42 deletions

File tree

nbproject/project.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endorsed.classpath=
5555
main.class=javapskmail.Main
5656
junit.selected.version=3
5757
source.encoding=UTF-8
58-
javac.source=1.7
58+
javac.source=1.8
5959
includes=**
6060
javadoc.use=true
6161
jar.compress=true
@@ -106,7 +106,7 @@ javac.test.modulepath=\
106106
${javac.modulepath}
107107
debug.test.classpath=${run.test.classpath}
108108
javac.external.vm=true
109-
javac.target=1.7
109+
javac.target=1.8
110110
platform.active=default_platform
111111
manifest.file=manifest.mf
112112
javadoc.html5=false

src/javapskmail/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
public class Main {
3535

3636
//VK2ETA: Based on "jpskmail 1.7.b";
37-
static String version = "3.1.8.4";
37+
static String version = "3.1.8.5";
3838
static String application = "jPskmail " + version;// Used to preset an empty status
39-
static String versionDate = "20230830";
39+
static String versionDate = "20240105";
4040
static String host = "localhost";
4141
static int port = 7322; //ARQ IP port
4242
static String xmlPort = "7362"; //XML IP port

src/javapskmail/MainPskmailUi.java

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,42 @@ public void actionPerformed(ActionEvent e) {
880880
if (Main.connected | Main.Connecting | Main.bulletinMode | Main.TxActive) {
881881
clientActive = true;
882882
}
883+
884+
//To-do: APRS-IS listening stops after 1 hour. Must renew subscription every 1/2 hour or so
885+
886+
//Time to send a server beacon if required
887+
//E.g: AFA1EO>PSKAPR,TCPIP*,qAC,T2UK:@092354z4353.57NP06955.94W&PSKmail 1.9.4 server
888+
/* from Perl server
889+
890+
if ($Aprs_connect == 1) {
891+
if (time() - $systime >= 60 * $posit_time) { ## 10 mins aprs beacon...
892+
$systime = time();
893+
# now do what we want....
894+
895+
my ($month, $hour, $min) = (gmtime) [3, 2, 1];
896+
$month = substr (("0" . $month), -2, 2);
897+
$hour = substr (("0" . $hour), -2, 2);
898+
$min = substr (("0" . $min), -2, 2);
899+
900+
my $mytime = $month . $hour . $min . "z";
901+
if (-e "$ENV{HOME}/.pskmail/aprs_wx.txt") {
902+
903+
my $WX = `cat "$ENV{HOME}/.pskmail/aprs_wx.txt"`;
904+
905+
if (index ($WX, "_") == 0) { $WX = substr($WX, 1);}
906+
907+
$MSG = "$ServerCall" . ">PSKAPR:" . "@" . $mytime . $Aprs_beacon . $WX ."\n";
908+
} else {
909+
$MSG = "$ServerCall" . ">PSKAPR:" . "@" . $mytime . $Aprs_beacon ."\n";
910+
}
911+
912+
aprs_send ($MSG);
913+
914+
# end
915+
}
916+
}
917+
*/
918+
883919
//Time to restart the modem? Skip the rest of the process then
884920
String everyXHoursStr = Main.configuration.getPreference("EVERYXHOURS", "1");
885921
int everyXHours = 1;
@@ -975,7 +1011,7 @@ public void actionPerformed(ActionEvent e) {
9751011
}
9761012
}
9771013

978-
// Ready to restart sanning (after a scan off command)
1014+
// Ready to restart scanning (after a scan off command)
9791015
if ((mnuMailScanning.isSelected() & !Main.connected) |
9801016
(!Main.connected & !Main.Connecting & !Main.monitorMode & !sendbeacon & !Main.bulletinMode)) {
9811017
if (Main.configuration.getPreference("SCANNER").equals("yes")) {
@@ -986,8 +1022,8 @@ public void actionPerformed(ActionEvent e) {
9861022
}
9871023
Main.summoning = false;
9881024
}
1025+
9891026
// set igate indicator
990-
9911027
if (Igate.connected) {
9921028
IgateIndicator.setText("Connected to " + Main.aprsServer);
9931029
} else {

src/javapskmail/Modem.java

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public class Modem implements Runnable {
6868
public boolean BlockActive = false;
6969
public boolean possibleCwFrame = false;
7070
private StringBuilder cwStringBuilder = new StringBuilder(100);
71-
//private int stxcount = 0;
7271
static String[] fldigimodes = {"unknown", "THOR 8>", "MFSK-16>", "THOR 22>", "MFSK-32>",
7372
"PSK-250R>", "PSK-500R>", "BPSK-500>", "BPSK-250>", "BPSK-125>",
7473
"BPSK-63>", "PSK-125R>", "MFSK-64>", "THOR 11>", "THOR 4>", "Contestia>",
@@ -127,7 +126,12 @@ public class Modem implements Runnable {
127126
public boolean commToFldigiOpened = false; // Use this to suppress errors when the port is closed
128127
public RMsgObject txMessage = null;
129128
public long expectedReturnToRxTime = 0L;
130-
129+
130+
public static final char SOH = 1;
131+
public static final char EOT = 4;
132+
public static final char DC1 = 17; //Olivia SOH replacement (used in jPskmail due to Fldigi limitations of Olivia's character set)
133+
public static final char DC2 = 18;
134+
public static final char DC3 = 19; //Olivia EOT replacement of
131135

132136
//RadioMsg stuff
133137
//Picture transfer conversion of speed to SPP (Samples Per Pixel) and vice-versa
@@ -720,7 +724,6 @@ public void Sendln(String outLine, String modemString, String TxRsidString) {
720724
}
721725
}
722726
if (!outLine.equals("")) {
723-
pout.println(outLine);
724727
if (!outLine.contains("<cmd>")) {
725728
//Must be a data block, reset receive marker of RSID for next RX
726729
//VK2ETA: TO-DO: check if logic (and place of decision) is consistent with RadioMsg
@@ -730,7 +733,12 @@ public void Sendln(String outLine, String modemString, String TxRsidString) {
730733
long txTime = (3000 * (long)(getTxTimeEstimate(txMode, outLine.getBytes("UTF-8").length)));
731734
System.out.println("txTime: " + txTime);
732735
expectedReturnToRxTime = System.currentTimeMillis() + txTime;
736+
//Olivia and MT-63 modes, replace SOH by DC1 and EOT by DC3 due to limitation in Olivia's and MT-63's character set in Fldigi (ch > 7 only)
737+
if (modemString.startsWith("OLIV") || modemString.startsWith("MT63")) {
738+
outLine = outLine.replace(SOH, DC1).replace(EOT, DC3);
739+
}
733740
}
741+
pout.println(outLine);
734742
}
735743
}
736744
} catch (Exception ex) {
@@ -1289,7 +1297,9 @@ private void GetBlock() {
12891297
switch (inChar) {
12901298
case 0:
12911299
break; // ignore
1292-
case 1: //SOH
1300+
case DC1:
1301+
inChar = SOH; //Valid Olivia SOH replacement. Exchange and fall through to processing of normal SOH
1302+
case SOH:
12931303
Main.lastCharacterTime = blockstart = System.currentTimeMillis();
12941304
Main.haveSOH = true;
12951305
//Just received RSID, restart counting Radio Msg header timeout from now
@@ -1322,7 +1332,9 @@ private void GetBlock() {
13221332
//VK2ETA not here
13231333
//Main.DCD = 0;
13241334
break;
1325-
case 4: //EOT
1335+
case DC3:
1336+
inChar = EOT; //Valid Olivia EOT replacement. Exchange and fall through to processing of normal EOT
1337+
case EOT:
13261338
// System.out.println("EOT:" + BlockString);
13271339
blocktime = (System.currentTimeMillis() - blockstart);
13281340
//VK2ETA debug extra status send when TXing long data in slow mode from server
@@ -1423,20 +1435,19 @@ private void GetBlock() {
14231435
//VK2ETA not here
14241436
//Main.DCD = 0;
14251437
break;
1426-
case 18:
1427-
// DC2 received
1438+
case DC2:
14281439
DC2_rcvd = true;
14291440
break;
14301441
default:
14311442
if (DC2_rcvd) {
1432-
notifier += (char)inChar;
1443+
notifier += (char) inChar;
14331444
//Not found char(62) ">" yet, check length
14341445
if (notifier.length() > 35) {
14351446
//Too long, false positive
14361447
DC2_rcvd = false;
14371448
notifier = "";
14381449
}
1439-
if ((char)inChar == 62) { // ">" character
1450+
if ((char) inChar == 62) { // ">" character
14401451
DC2_rcvd = false;
14411452
// System.out.println(notifier);
14421453
// <s2n: 58, 100.0, 0.0>
@@ -1490,7 +1501,7 @@ private void GetBlock() {
14901501
notifier = "";
14911502
}
14921503
}
1493-
if ((char)inChar > 31 & !DC2_rcvd) {
1504+
if ((char) inChar > 31 & !DC2_rcvd) {
14941505
if (Main.wantbulletins) {
14951506
try {
14961507
// Main.Bul.get("" + inChar);
@@ -1502,12 +1513,12 @@ private void GetBlock() {
15021513
//Build sequence for CW APRS messages
15031514
if (possibleCwFrame) {
15041515
//Continue building the sequence and reject if does not conform to expected format
1505-
cwStringBuilder.append((char)inChar);
1516+
cwStringBuilder.append((char) inChar);
15061517
if (cwStringBuilder.length() > 68) { //Around 50 characters max for status or message
15071518
//Too long, erase and reset flag
15081519
cwStringBuilder.setLength(0);
15091520
possibleCwFrame = false;
1510-
} else if (cwStringBuilder.length() > 5
1521+
} else if (cwStringBuilder.length() > 5
15111522
&& cwStringBuilder.toString().contains("VVV--")) {
15121523
//Align start at last discovery of header start (in the case of
15131524
// a send error, the opertor can ignore the rest of the message and
@@ -1527,7 +1538,7 @@ private void GetBlock() {
15271538
} catch (NumberFormatException e) {
15281539
sentDataLen = 0;
15291540
}
1530-
int dataLen = (cwBeaconMatcher.group(1) + "/"
1541+
int dataLen = (cwBeaconMatcher.group(1) + "/"
15311542
+ cwBeaconMatcher.group(2) + "/"
15321543
+ cwBeaconMatcher.group(3) + "/").length();
15331544
//Check the conversion to GPS coordinates
@@ -1540,12 +1551,12 @@ private void GetBlock() {
15401551
BlockString = "00u" + scall
15411552
+ ":26 !" + gpsLatLon + cwBeaconMatcher.group(5)
15421553
+ cwBeaconMatcher.group(3);
1543-
String check = Main.q.checksum(BlockString);
1544-
BlockString = "<SOH>" + BlockString + check + "<EOT>";
1545-
possibleCwFrame = false; //Reset flag
1546-
Main.isCwFrame = true;
1547-
putMessage(BlockString);
1548-
BlockString = "";
1554+
String check = Main.q.checksum(BlockString);
1555+
BlockString = "<SOH>" + BlockString + check + "<EOT>";
1556+
possibleCwFrame = false; //Reset flag
1557+
Main.isCwFrame = true;
1558+
putMessage(BlockString);
1559+
BlockString = "";
15491560
} else {
15501561
//Send NACK
15511562
Main.isCwFrame = true;
@@ -1564,8 +1575,8 @@ private void GetBlock() {
15641575
sentDataLen = Integer.parseInt(cwAprsMsgMatcher.group(6));
15651576
} catch (NumberFormatException e) {
15661577
sentDataLen = 0;
1567-
}
1568-
int dataLen = (cwAprsMsgMatcher.group(1) + "/25/"
1578+
}
1579+
int dataLen = (cwAprsMsgMatcher.group(1) + "/25/"
15691580
+ cwAprsMsgMatcher.group(2) + "/"
15701581
+ cwAprsMsgMatcher.group(3) + "/"
15711582
+ cwAprsMsgMatcher.group(4) + "/"
@@ -1575,34 +1586,34 @@ private void GetBlock() {
15751586
//Build the new block with the received information
15761587
//"00u" + scall + ":25" + spaces1 + email + spaces2 + body + "\n";
15771588
BlockString = "00u" + scall
1578-
+ ":25 " + cwAprsMsgMatcher.group(2) + "@"
1589+
+ ":25 " + cwAprsMsgMatcher.group(2) + "@"
15791590
+ cwAprsMsgMatcher.group(3) + "."
15801591
+ cwAprsMsgMatcher.group(4) + " "
15811592
+ cwAprsMsgMatcher.group(5) + "\n";
1582-
String check = Main.q.checksum(BlockString);
1583-
BlockString = "<SOH>" + BlockString + check + "<EOT>";
1584-
possibleCwFrame = false; //Reset flag
1585-
Main.isCwFrame = true;
1586-
putMessage(BlockString);
1587-
BlockString = "";
1593+
String check = Main.q.checksum(BlockString);
1594+
BlockString = "<SOH>" + BlockString + check + "<EOT>";
1595+
possibleCwFrame = false; //Reset flag
1596+
Main.isCwFrame = true;
1597+
putMessage(BlockString);
1598+
BlockString = "";
15881599
} else {
15891600
//Send NACK
15901601
Main.isCwFrame = true;
15911602
Main.q.send_NACK_reply();
15921603
}
15931604
//Consume data
15941605
cwStringBuilder.setLength(0);
1595-
}
1606+
}
15961607
}
1597-
} else if ((char)inChar == 'V') {
1608+
} else if ((char) inChar == 'V') {
15981609
possibleCwFrame = true;
1599-
cwStringBuilder.append((char)inChar);
1600-
}
1601-
WriteToMonitor((char)inChar);
1610+
cwStringBuilder.append((char) inChar);
1611+
}
1612+
WriteToMonitor((char) inChar);
16021613
}
16031614
if (BlockActive) {
1604-
BlockString += (char)inChar;
1605-
newLine += (char)inChar;
1615+
BlockString += (char) inChar;
1616+
newLine += (char) inChar;
16061617
Main.lastCharacterTime = System.currentTimeMillis();
16071618
// System.out.println("BS:" + BlockString);
16081619
//Determine if this is a status frame coming
@@ -1614,7 +1625,7 @@ private void GetBlock() {
16141625
// single character to "<SOH>" or "<EOT>" string (Fldigi specific)
16151626
if (BlockString.length() > 280) {
16161627
BlockActive = false;
1617-
BlockString = "";
1628+
BlockString = "";
16181629
}
16191630
}
16201631
break;

0 commit comments

Comments
 (0)