fix(icom net): a sleeping rig keeps its session, and the console is reachable
From an operator's log: an IC-7760 in standby, and OpsLog dialling and dropping every forty seconds for as long as it was left there — control link up, login OK, token renewed, and not one CI-V answer. lastGoodAt bounds "the link answers but no CI-V comes back". It belongs to a session and was never cleared when a new one opened, so a rig that went to standby half an hour ago handed every fresh session a half-hour-old last good read: past the grace before the first command was even sent. Torn down at once, redialled twenty seconds later, torn down again. Cleared on connect, the rule reads as it was written — silent since connect is a rig in standby, and the session is kept so it can be woken. The console it is woken from was missing too. It appeared only once the live CAT state said "icom", which a sleeping rig never says, so the ON button was absent at the one moment it exists for. It now follows the CONFIGURED radio — which also had to start following a radio switched from the status bar, instead of waiting for a trip through Settings and a Save that changed nothing.
This commit is contained in:
@@ -232,6 +232,21 @@ func (b *IcomSerial) Connect() error {
|
||||
_ = port.SetRTS(false)
|
||||
b.port = port
|
||||
b.model = civ.ModelName(b.rigAddr)
|
||||
// A NEW SESSION IS NOT JUDGED ON THE OLD ONE'S SILENCE.
|
||||
//
|
||||
// lastGoodAt bounds "the control link answers but no CI-V comes back". It
|
||||
// belongs to a session, and it was never cleared when a new one opened —
|
||||
// so a rig that went to standby half an hour ago handed every fresh session
|
||||
// a half-hour-old "last good read", which is past the grace before the first
|
||||
// command is even sent. The session was torn down at once, redialled twenty
|
||||
// seconds later, and torn down again: a loop with no way out, and the Icom
|
||||
// console (with its power-ON button) blinking away on every pass.
|
||||
//
|
||||
// Cleared, the rule reads as it was written: silent since connect is a rig in
|
||||
// standby, and the session is kept so the operator can wake it.
|
||||
b.lastGoodAt = time.Time{}
|
||||
b.readFails = 0
|
||||
b.silentGrace = icomSilentGrace
|
||||
|
||||
// Start the reader before any request: recv() now waits on respCh, which only
|
||||
// the reader feeds. respCh is buffered so a burst (or the scope stream) never
|
||||
|
||||
Reference in New Issue
Block a user