feat: While using Flex & Steppir or Ultrabeam can prevent transmit when antenna is moving
This commit is contained in:
+15
-1
@@ -286,19 +286,33 @@ func (n *icomNet) ctrlPump() {
|
||||
switch icnLE.Uint16(buf[4:]) {
|
||||
case 0x07: // ping
|
||||
_, _ = n.ctrl.Write(icnPingReply(buf[:k], n.cID, n.cRemote))
|
||||
case 0x00: // idle keepalive from the rig — nothing to do
|
||||
case 0x01: // retransmit request — resend from the CONTROL sent-buffer
|
||||
if k >= 8 {
|
||||
n.ctrlResend(icnLE.Uint16(buf[6:]))
|
||||
}
|
||||
case 0x05: // rig-initiated disconnect — it dropped US
|
||||
debugLog.Printf("icom net: rig sent DISCONNECT on control stream — session dropped by the rig")
|
||||
default:
|
||||
// Anything else on the control stream is (almost always) the rig's
|
||||
// reply to our token renewal. Log it: a 0x40-length token packet
|
||||
// carries a result code, and if the rig is REJECTING renewals this is
|
||||
// where the ~2-3 min disconnect originates. The hex makes the cause
|
||||
// visible in the friend's log without a protocol analyzer.
|
||||
if k >= 0x18 {
|
||||
debugLog.Printf("icom net: control reply len=%d head=% X", k, buf[:0x18])
|
||||
} else {
|
||||
debugLog.Printf("icom net: control reply len=%d head=% X", k, buf[:k])
|
||||
}
|
||||
}
|
||||
}
|
||||
if time.Since(lastIdle) > 100*time.Millisecond {
|
||||
_, _ = n.ctrl.Write(icnCtrl(0x00, 0, n.cID, n.cRemote))
|
||||
lastIdle = time.Now()
|
||||
}
|
||||
if time.Since(lastToken) > 45*time.Second {
|
||||
// Renew well inside the rig's ~2-min token timeout. 30 s (was 45) leaves room
|
||||
// for one lost renewal + its retransmit before the token would lapse.
|
||||
if time.Since(lastToken) > 30*time.Second {
|
||||
n.renewToken()
|
||||
lastToken = time.Now()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user