summaryrefslogtreecommitdiff
path: root/KAMPactor.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-07-14 23:14:11 +0100
committerDave Hibberd <hibby@debian.org>2025-07-14 23:14:11 +0100
commitb2315840b26a7ae5c38b0f9ed25e597f320c545e (patch)
tree4eaec3a3c8f5825155c5a94161dbd7e360a35c0e /KAMPactor.c
parent0d3ee7fd56efa24ba652fbc17f98dd10458e8054 (diff)
New upstream version 6.0.24.75+repackupstream/6.0.24.75+repack
Diffstat (limited to 'KAMPactor.c')
-rw-r--r--KAMPactor.c123
1 files changed, 111 insertions, 12 deletions
diff --git a/KAMPactor.c b/KAMPactor.c
index ec461d3..239b183 100644
--- a/KAMPactor.c
+++ b/KAMPactor.c
@@ -915,24 +915,39 @@ VOID KAMPoll(int Port)
calllen = ConvFromAX25(TNC->PortRecord->ATTACHEDSESSIONS[0]->L4USER, TNC->Streams[0].MyCall);
TNC->Streams[0].MyCall[calllen] = 0;
- EncodeAndSend(TNC, "X", 1); // ??Return to packet mode??
- if (TNC->VeryOldMode)
- datalen = sprintf(TXMsg, "C20MYCALL %s", TNC->Streams[0].MyCall);
- else
- datalen = sprintf(TXMsg, "C20MYPTCALL %s", TNC->Streams[0].MyCall);
+ EncodeAndSend(TNC, "X", 1); // ??Return to packet mode??
+
+ if (TNC->VeryOldMode)
+ {
+ datalen = sprintf(TXMsg, "C20MYCALL %s", TNC->Streams[0].MyCall);
+ EncodeAndSend(TNC, TXMsg, datalen);
+ }
+ else
+ {
+ datalen = sprintf(TXMsg, "C20MYPTCALL %s", TNC->Streams[0].MyCall);
EncodeAndSend(TNC, TXMsg, datalen);
- TNC->InternalCmd = 'M';
+
+ if (TNC->OldMode == 0)
+ {
+ EncodeAndSend(TNC, TXMsg, datalen);
+ datalen = sprintf(TXMsg, "C20MYGTCALL %s", TNC->Streams[0].MyCall);
+ }
+ }
+
+ TNC->InternalCmd = 'M';
- TNC->NeedPACTOR = 0; // Cancel enter Pactor
+ TNC->NeedPACTOR = 0; // Cancel enter Pactor
- sprintf(TNC->WEB_TNCSTATE, "In Use by %s", TNC->Streams[0].MyCall);
- SetWindowText(TNC->xIDC_TNCSTATE, TNC->WEB_TNCSTATE);
+ SuspendOtherPorts(TNC);
- // Stop Scanning
+ sprintf(TNC->WEB_TNCSTATE, "In Use by %s", TNC->Streams[0].MyCall);
+ SetWindowText(TNC->xIDC_TNCSTATE, TNC->WEB_TNCSTATE);
- sprintf(Msg, "%d SCANSTOP", TNC->Port);
+ // Stop Scanning
+
+ sprintf(Msg, "%d SCANSTOP", TNC->Port);
- Rig_Command( (TRANSPORTENTRY *) -1, Msg);
+ Rig_Command( (TRANSPORTENTRY *) -1, Msg);
}
}
@@ -1065,9 +1080,22 @@ VOID KAMPoll(int Port)
UCHAR TXMsg[80] = "D20";
if (TNC->VeryOldMode)
+ {
datalen = sprintf(TXMsg, "C20MYCALL %s", TNC->NodeCall);
+ EncodeAndSend(TNC, TXMsg, datalen);
+ }
else
+ {
datalen = sprintf(TXMsg, "C20MYPTCALL %s", TNC->NodeCall);
+ EncodeAndSend(TNC, TXMsg, datalen);
+
+ if (TNC->OldMode == 0)
+ {
+ datalen = sprintf(TXMsg, "C20MYGTCALL %s", TNC->NodeCall);
+ EncodeAndSend(TNC, TXMsg, datalen);
+ }
+ }
+
EncodeAndSend(TNC, TXMsg, datalen);
if (TNC->OldMode)
@@ -1075,6 +1103,7 @@ VOID KAMPoll(int Port)
else
EncodeAndSend(TNC, "C20TOR", 6); // Back to Listen
+
TNC->InternalCmd = 'T';
TNC->Timeout = 50;
TNC->IntCmdDelay--;
@@ -1758,6 +1787,76 @@ VOID ProcessKHOSTPacket(struct TNCINFO * TNC, UCHAR * Msg, int Len)
if (Msg[0] == '?') // Status
{
TNC->Timeout = 0;
+
+/*
+ The response frame from the TNC will be:
+ <FEND>?0MSXY<FEND> - where MSXY are coded as follows:
+ M One byte indicating the current mode of operation.
+ A=Packet
+ B=RTTY
+ C=ASCII
+ D=AMTOR
+ E=FEC
+ F=SELFEC
+ G=LAMTOR
+ H=PACTOR
+ I=PTLISTEN
+ J=GTOR
+ K=NAVTEX
+ L=CW
+ M=TOR Standby
+ N=GMON
+ O=PSK31
+ S One byte indicating a sub-mode of operation. The byte
+ contains an ASCII character as follows:
+ 0=Standby
+ 1=Phasing
+ 2=Connected
+ 3=Disconnecting
+ 4=FEC
+ 5=SELFEC
+ 6=PTFEC
+ X One byte (called status byte X). This byte is bit-
+ encoded to indicate specific conditions as follows:
+ Bit 0 = (IDLE) set to 1 when receiving IDLE
+ characters in a frame.
+ Bit 1 = (ERR) set to 1 to indicate the received frame
+ failed CRC check, or was not a valid CS
+ response frame.
+ Bit 2 = (Combined receive) set to 1 to indicate that
+ the data was constructed through the use of
+ error correction (i.e. Golay error correction
+ for G-TOR or Memory ARQ for Pactor).
+ Bit 3 = (RQ) set to 1 to indicate an RQ frame. If you
+ are the ISS, it indicates that the receiving
+ station has asked for a repeat of the last
+ data due to received errors. When you are the
+ IRS, it indicates that the transmitting
+ station has sent the same data that you have
+ already received. This means that the sending
+ station did not properly copy your
+ acknowledgement (CS code).
+ Bit 4 = (Huffman) set to 1 to indicate that this
+ frame contains data which uses Huffman
+ compression.
+ Bit 5 = (ISS) set to 1 to indicate that your station
+ is currently the ISS.
+ Bit 6&7 = (Speed) these two bits indicate the current
+ speed of an ARQ link or the PSK31 mode. The
+ coding of the bits is:
+ 00 = 100 baud or BPSK31
+ 01 = 200 baud or QPSK31
+ 10 = 300 baud
+ Y One byte (called status byte Y). This byte is bit-
+ encoded to indicate specific conditions as follows:
+ Bit 0 = reserved (set to 0).
+ Bit 1 = (PTT) PTT is active.
+ Bit 2 = (Changeover) changeover in progress
+ Bits 3-7 = reserved (set to 0).
+*/
+
+
+
return;
}