Browse Source

ptc-go changed scheme from ptc:// to pactor://

Issue #40
Martin Hebnes Pedersen 10 months ago
parent
commit
6149cb77c5
4 changed files with 15 additions and 12 deletions
  1. 3 3
      cfg/config.go
  2. 8 8
      connect.go
  3. 1 1
      main.go
  4. 3 0
      usage.go

+ 3 - 3
cfg/config.go

@@ -53,7 +53,7 @@ type Config struct {
 	SerialTNC SerialTNCConfig `json:"serial-tnc"` // See SerialTNCConfig.
 	Winmor    WinmorConfig    `json:"winmor"`     // See WinmorConfig.
 	Ardop     ArdopConfig     `json:"ardop"`      // See ArdopConfig.
-	PTC       PTCConfig       `json:"ptc"`        // See PTCConfig.
+	Pactor    PactorConfig    `json:"pactor"`     // See PactorConfig.
 	Telnet    TelnetConfig    `json:"telnet"`     // See TelnetConfig.
 
 	// Address and port to a GPSd daemon for position reporting.
@@ -132,7 +132,7 @@ type ArdopConfig struct {
 	CWID bool `json:"cwid_enabled"`
 }
 
-type PTCConfig struct {
+type PactorConfig struct {
 	// Path/port to TNC device (e.g. /dev/ttyUSB0 or COM1).
 	Path string `json:"path"`
 
@@ -217,7 +217,7 @@ var DefaultConfig Config = Config{
 		ARQBandwidth: ardop.Bandwidth500Max,
 		CWID:         true,
 	},
-	PTC: PTCConfig{
+	Pactor: PactorConfig{
 		Path:     "/dev/ttyUSB0",
 		Baudrate: 57600,
 	},

+ 8 - 8
connect.go

@@ -79,16 +79,16 @@ func Connect(connectStr string) (success bool) {
 			if config.SerialTNC.Baudrate > 0 {
 				url.Params.Set("baud", fmt.Sprint(config.SerialTNC.Baudrate))
 			}
-		case "ptc":
-			url.Host = config.PTC.Path
-			if config.PTC.Baudrate > 0 {
-				url.Params.Set("baud", fmt.Sprint(config.PTC.Baudrate))
+		case "pactor":
+			url.Host = config.Pactor.Path
+			if config.Pactor.Baudrate > 0 {
+				url.Params.Set("baud", fmt.Sprint(config.Pactor.Baudrate))
 			}
 		}
 	}
 
-	if url.Scheme == "ptc" && config.PTC.InitScript != "" && url.Params.Get("init_script") == "" {
-		url.Params.Set("init_script", config.PTC.InitScript)
+	if url.Scheme == "pactor" && config.Pactor.InitScript != "" && url.Params.Get("init_script") == "" {
+		url.Params.Set("init_script", config.Pactor.InitScript)
 	}
 
 	// Radio Only?
@@ -172,8 +172,8 @@ func qsy(method, addr string) (revert func(), err error) {
 		rigName = config.Ardop.Rig
 	case MethodAX25:
 		rigName = config.AX25.Rig
-	case MethodPTC:
-		rigName = config.PTC.Rig
+	case MethodPactor:
+		rigName = config.Pactor.Rig
 	default:
 		return noop, fmt.Errorf("Not supported with transport '%s'", method)
 	}

+ 1 - 1
main.go

@@ -39,7 +39,7 @@ const (
 	MethodTelnet    = "telnet"
 	MethodAX25      = "ax25"
 	MethodSerialTNC = "serial-tnc"
-	MethodPTC       = "ptc"
+	MethodPactor    = "pactor"
 )
 
 var commands = []Command{

+ 3 - 0
usage.go

@@ -13,6 +13,7 @@ transport:
   ax25:       AX.25 (Linux only)
   telnet:     TCP/IP
   serial-tnc: Serial AX.25 TNC
+  pactor:     SCS PTC modems
 
 host:
   Used to address the host interface (TNC/modem), _not_ to be confused with the connection PATH.
@@ -20,6 +21,7 @@ host:
 
   telnet:       [user:pass]@host:port
   ax25:         (optional) host=axport
+  pactor:       (optional) serial device (e.g. COM1 or /dev/ttyUSB0)
 
 path:
   The last element of the path is the target station's callsign. If the path has
@@ -39,6 +41,7 @@ params:
   connect ardop:///LA3F              Connect to the RMS HF Gateway LA3F using ARDOP on the default tcp address and port.
   connect ardop:///LA3F?freq=5350    Same as above, but set dial frequency of the radio using rigcontrol.  
   connect serial-tnc:///LA1B-10      Connect to the RMS Gateway LA1B-10 over a AX.25 serial TNC on the default serial port.
+  connect pactor:///LA3F             Connect to RMS HF Gateway LA3F using PACTOR.
 `
 )