Skip to content

Commit

Permalink
ardop: Add experimental FSKONLY mode
Browse files Browse the repository at this point in the history
Set `ARDOP_FSKONLY_EXPERIMENT=1` to enable this.

Ref #84
  • Loading branch information
martinhpedersen committed May 20, 2023
1 parent 707c6f9 commit 1d16f83
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transport/ardop/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const (
cmdFECmode command = "FECMODE" // FECMODE<8FSK.200.25|4FSK.200.50S|4FSK.200.50,4PSK.200.100S|4PSK.200.100|8PSK.200.100|16FSK.500.25S|16FSK.500.25|4FSK.500.100S|4FSK.500.100| 4PSK.500.100|8PSK.500.100|4PSK.500.167|8PSK.500.167|4FSK.1000.100|4PSK.1000.100|8PSK.1000.100|4PSK.1000.167|8PSK.1000.167|4FSK.2000.600S|4FSK.2000.600|4FSK.2000.100|4PSK.2000.100|8PSK.2000.100|4PSK.2000.167|8PSK.2000.167
cmdFECrepeats command = "FECREPEATS" // <0-5> Sets the number of times a frame is repeated in FEC (multicast) mode. Higher number of repeats increases good copy probability under marginal conditions but reduces net throughput.
cmdFECsend command = "FECSEND" // Start/Stop FEC broadcast/multicast mode for specific FECMODE. FECSEND <False> will abort a FEC broadcast.
cmdFSKOnly command = "FSKONLY" // <TRUE|FALSE> If true, only FSK modulation are used for ARQ connections (ARDOPc only?)

)

Expand Down Expand Up @@ -128,7 +129,7 @@ func parseCtrlMsg(str string) ctrlMsg {

switch msg.cmd {
// bool
case cmdCodec, cmdPTT, cmdBusy, cmdTwoToneTest, cmdCWID, cmdListen, cmdAutoBreak:
case cmdCodec, cmdPTT, cmdBusy, cmdTwoToneTest, cmdCWID, cmdListen, cmdAutoBreak, cmdFSKOnly:
msg.value = strings.ToLower(parts[1]) == "true"

// Undocumented
Expand Down
16 changes: 16 additions & 0 deletions transport/ardop/tnc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import (
"io"
"log"
"net"
"os"
"runtime"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -153,6 +155,13 @@ func (tnc *TNC) init() (err error) {
return fmt.Errorf("Disable listen failed: %s", err)
}

// FSKONLY experiment
if t, _ := strconv.ParseBool(os.Getenv("ARDOP_FSKONLY_EXPERIMENT")); t {
if err = tnc.setFSKOnly(true); err != nil {
return fmt.Errorf("Set FSK only failed: %s", err)
}
log.Println("Experimental FSKONLY mode enabled")
}
return nil
}

Expand Down Expand Up @@ -536,6 +545,13 @@ func (tnc *TNC) SetListenEnabled(listen bool) error {
return tnc.set(cmdListen, fmt.Sprintf("%t", listen))
}

// Enable/disable the FSKONLY mode.
//
// When enabled, the TNC will only use FSK modulation for ARQ connections.
func (tnc *TNC) setFSKOnly(t bool) error {
return tnc.set(cmdFSKOnly, fmt.Sprintf("%t", t))
}

// Disconnect gracefully disconnects the active connection or cancels an ongoing connect.
//
// The method will block until the TNC is disconnected.
Expand Down

0 comments on commit 1d16f83

Please sign in to comment.