test: drive the Kenwood backend against a rig that answers
Nobody here owns a Kenwood, and a backend that has never completed a single exchange is a guess however carefully it was written. But this repository already contains the other half of the conversation: internal/catemu ANSWERS this dialect, pretending to be a TS-2000 so an ACOM amplifier follows OpsLog. The test's responder replies exactly as catemu does — same FA/FB widths, same 38-character IF layout, same ID019 — so the two halves are checked against each other instead of against my reading of a manual. Connect adds a dialPort seam for this; nothing else changed in the backend. Covered: model identification, simplex on A, everything following the VFO in use when on B, tuning writing to that VFO rather than blindly to FA, split with TX and RX the right way round (ADIF FREQ is the TRANSMIT frequency — swapping them writes the wrong frequency into every logged QSO), the mode digit, and a silent port reported as not answering rather than as a connected radio. The last three are each a fault that actually reached a user through the Yaesu backend. What this does NOT prove: that a real TS-590 answers on the same timings, or fills every IF field the way its documentation says. That still needs a radio.
This commit is contained in:
+15
-1
@@ -48,6 +48,12 @@ type Kenwood struct {
|
||||
mu sync.Mutex
|
||||
port serial.Port
|
||||
|
||||
// dialPort, when set, replaces serial.Open. It exists so the backend can be
|
||||
// driven against internal/catemu — which already SPEAKS this dialect to
|
||||
// satisfy an ACOM amplifier — without a radio, a COM port or a null-modem
|
||||
// pair. Written for a Kenwood backend nobody here owns a rig to test.
|
||||
dialPort func() (serial.Port, error)
|
||||
|
||||
model string
|
||||
curFreq int64
|
||||
curRXFreq int64
|
||||
@@ -82,7 +88,7 @@ func (k *Kenwood) Connect() error {
|
||||
_ = k.port.Close()
|
||||
k.port = nil
|
||||
}
|
||||
p, err := serial.Open(k.portName, &serial.Mode{BaudRate: k.baud})
|
||||
p, err := k.openPort()
|
||||
if err != nil {
|
||||
return fmt.Errorf("kenwood: open %s @ %d baud: %w", k.portName, k.baud, err)
|
||||
}
|
||||
@@ -411,3 +417,11 @@ var kenwoodModels = map[string]string{
|
||||
"024": "TS-990S",
|
||||
"025": "TS-890S",
|
||||
}
|
||||
|
||||
// openPort opens the serial link, or whatever dialPort provides in a test.
|
||||
func (k *Kenwood) openPort() (serial.Port, error) {
|
||||
if k.dialPort != nil {
|
||||
return k.dialPort()
|
||||
}
|
||||
return serial.Open(k.portName, &serial.Mode{BaudRate: k.baud})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user