Android-1026: Freq Change won't work via network with IC-705 - #789
Open
patrickrb wants to merge 2 commits into
Open
Android-1026: Freq Change won't work via network with IC-705#789patrickrb wants to merge 2 commits into
patrickrb wants to merge 2 commits into
Conversation
Follow-up to PR #774 (CI-V address hex/decimal fix). After that fix the app could COMMAND an IC-705 correctly, but the operator report on the issue was "Frequency update works, but there's no change in FT8AF if I change the QRG on the IC 705" — rig→app dial follow was still broken. Root cause: IcomRig has no CAT-side frequency poll of its own. Every other CAT rig class runs one (Yaesu38Rig, Yaesu39Rig, KenwoodTS590Rig, ElecraftRig, XieGuRig, TrUSDXRig, GuoHeQ900Rig, YaesuDX10Rig, Flex6000Rig, KenwoodKT90Rig, Wolf_sdr_450Rig, Yaesu2Rig, Yaesu2_847Rig, Yaesu38_450Rig, KenwoodTS2000Rig) — IcomRig was the odd one out, relying solely on CatLiveness's 3 s liveness probe. That watchdog stops hard on an 8 s quiet timeout, so any transient hush on the link (a coalesced retransmit, a slow login-recovery frame) leaves the app permanently out of sync with the rig's dial until the operator reconnects. Fix: IcomRig now runs its own 2 s frequency poll using the shared ReadTaskAction decision (connected + PTT-off → read frequency, PTT-on → defer to the 500 ms meter timer, disconnected → skip). onDisconnecting is overridden to cancel both this timer and the existing meter timer, so a reconnect via MainViewModel.connectRig doesn't leak the previous instance's Timer thread or double-poll after re-connect. Tests: IcomRigReadFreqPollTest covers all four tick decisions plus the readFreqFromRig frame bytes, using a CapturingConnector so no Timer or Robolectric is required. Full unit suite still passes (3491 tests, 0 failures). Closes #753 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #789 +/- ##
=========================================
Coverage 42.34% 42.34%
Complexity 226 226
=========================================
Files 267 267
Lines 31834 31834
Branches 3650 3650
=========================================
Hits 13479 13479
Misses 18097 18097
Partials 258 258
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Poll startup can race the initial retune, and an exception can permanently terminate polling.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds dedicated ICOM frequency polling so FT8AF follows rig-side dial changes.
Changes:
- Polls ICOM frequency every two seconds while connected and not transmitting.
- Cancels polling and meter timers during disconnection.
- Adds polling decision and cleanup tests.
File summaries
| File | Description |
|---|---|
IcomRig.java |
Adds frequency polling and timer cleanup. |
IcomRigReadFreqPollTest.java |
Tests polling decisions and idempotent cleanup. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #753
What changed
Follow-up to PR #774 (CI-V address hex/decimal fix). After that fix the app
could command the IC-705 over CI-V correctly, but the operator's follow-up
report was:
i.e. rig→app dial-follow was still broken. Root cause was that
IcomRighadno CAT-side frequency poll of its own. Every other CAT rig class in this
codebase runs one (Yaesu38Rig, Yaesu39Rig, KenwoodTS590Rig, ElecraftRig,
XieGuRig, TrUSDXRig, GuoHeQ900Rig, YaesuDX10Rig, Flex6000Rig, KenwoodKT90Rig,
Wolf_sdr_450Rig, Yaesu2Rig, Yaesu2_847Rig, Yaesu38_450Rig, KenwoodTS2000Rig) —
IcomRigwas the odd one out, relying solely onCatLiveness's 3 s livenessprobe. That watchdog stops hard on an 8 s quiet timeout, so any transient hush
on the link leaves the app permanently out of sync with the rig's dial until
the operator manually reconnects.
IcomRignow runs its own 2 s frequency poll using the sharedReadTaskActiondecision (connected + PTT-off → read frequency,PTT-on → defer to the 500 ms meter timer,disconnected → skip).onDisconnecting()is overridden to cancel both this timer and the existingmeter timer, so a reconnect via
MainViewModel.connectRigdoesn't leak theprevious instance's
Timerthread or double-poll after re-connect.Files touched:
ft8af/app/src/main/java/com/k1af/ft8af/rigs/IcomRig.java— newstartReadFreqTimer()/runReadFreqTick()+onDisconnecting()override.ft8af/app/src/test/java/com/k1af/ft8af/rigs/IcomRigReadFreqPollTest.java—five new tests using a
CapturingConnectorfake so noTimerorRobolectric is required.
How to test
Automated (macOS/Linux with JDK 17, or Windows via the
gradlew.batwrapper — see CLAUDE.md):
Full suite also stays green:
Result on this branch: 3491 tests, 0 failures.
On an IC-705 (network / WLAN):
cd ft8af && ./gradlew installDebug(Windows:gradlew.bat installDebug).connection dialog. Confirm the CAT chip goes green.
Before this change it stayed on the old dial until reconnect.
frequency mid-transmit (the 500 ms meter poll still runs, so SWR/ALC keep
updating).
The same follow behaviour also applies to any other ICOM over any transport
(USB serial, Bluetooth, WLAN) —
IcomRigis the shared class.🤖 Generated with Claude Code