chore(rigctld): trace the client exchange
Only PTT transitions were recorded. So when JTDX aborted a transmission 0.86 seconds into a 13.8-second frame, the log showed the abort and the Fake It frequency restore around it — and not the command that preceded them, which is the one thing needed to tell whether OpsLog answered something the client could not accept. Behind the existing CAT wire-trace switch rather than a new one: this is a line per poll and would drown an ordinary log, and an operator chasing a rig-control fault turns that trace on already.
This commit is contained in:
@@ -32,6 +32,7 @@ package rigctld
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"hamlog/internal/cat"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -244,7 +245,18 @@ func (s *Server) serve(c net.Conn) {
|
||||
s.log("rigctld: client %s disconnected", c.RemoteAddr())
|
||||
return
|
||||
}
|
||||
resp, quit := s.handle(strings.TrimSpace(line))
|
||||
req := strings.TrimSpace(line)
|
||||
resp, quit := s.handle(req)
|
||||
// The whole exchange, when tracing is on.
|
||||
//
|
||||
// Only PTT transitions were ever recorded, so when JTDX aborted a
|
||||
// transmission mid-frame the log showed the abort and not the command
|
||||
// that preceded it — the one thing needed to tell whether OpsLog answered
|
||||
// something the client could not accept. Behind the same switch as the CAT
|
||||
// wire trace: this is one line per poll and would drown an ordinary log.
|
||||
if req != "" && cat.CIVTraceEnabled() {
|
||||
s.log("rigctld: %s → %q ⇒ %q", c.RemoteAddr(), req, strings.TrimRight(resp, "\r\n"))
|
||||
}
|
||||
if resp != "" {
|
||||
if _, err := w.WriteString(resp); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user