diff --git a/internal/cat/icomnet.go b/internal/cat/icomnet.go index 5f79529..958a17c 100644 --- a/internal/cat/icomnet.go +++ b/internal/cat/icomnet.go @@ -510,7 +510,23 @@ func (n *icomNet) civPump() { debugLog.Printf("icom net: the reopen did not bring CI-V back — forcing a fresh session") } if time.Since(lastIdle) > 150*time.Millisecond { - _, _ = n.civ.Write(icnCtrl(0x00, 0, n.vID, n.vRemote)) + // Idles carry a REAL sequence number, drawn from the same counter as + // the data packets, and sit in the retransmit buffer like them — + // which is how RS-BA1 and wfview number theirs. Ours used seq 0 on + // every idle, seven a second, interleaved with properly-numbered + // data; a rig that follows the sequence tolerates that for a minute + // or so and then stops serving CI-V data on the stream — which is + // the shape of every dropout this loaner IC-7760 has shown, with + // the scope and the TX path both since eliminated. + n.seqMu.Lock() + iseq := n.vTracked + n.vTracked++ + n.seqMu.Unlock() + ipkt := icnCtrl(0x00, iseq, n.vID, n.vRemote) + n.sentMu.Lock() + n.sentBuf[iseq] = ipkt + n.sentMu.Unlock() + _, _ = n.civ.Write(ipkt) lastIdle = time.Now() } if time.Since(lastReq) > 100*time.Millisecond {