Skip to content

Android-1026: Freq Change won't work via network with IC-705 - #789

Open
patrickrb wants to merge 2 commits into
devfrom
optio/task-21e7902b-9623-447b-b2ec-ec30c951c96d
Open

Android-1026: Freq Change won't work via network with IC-705#789
patrickrb wants to merge 2 commits into
devfrom
optio/task-21e7902b-9623-447b-b2ec-ec30c951c96d

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

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:

Frequency update works, but there's no change in FT8AF, if I change the QRG
on the IC 705.

i.e. rig→app dial-follow was still broken. Root cause was that IcomRig had
no 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) —
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 leaves the app permanently out of sync with the rig's dial until
the operator manually reconnects.

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.

Files touched:

  • ft8af/app/src/main/java/com/k1af/ft8af/rigs/IcomRig.java — new
    startReadFreqTimer() / runReadFreqTick() + onDisconnecting() override.
  • ft8af/app/src/test/java/com/k1af/ft8af/rigs/IcomRigReadFreqPollTest.java
    five new tests using a CapturingConnector fake so no Timer or
    Robolectric is required.

How to test

Automated (macOS/Linux with JDK 17, or Windows via the gradlew.bat
wrapper — see CLAUDE.md):

cd ft8af && ./gradlew testDebugUnitTest --tests com.k1af.ft8af.rigs.IcomRigReadFreqPollTest

Full suite also stays green:

cd ft8af && ./gradlew testDebugUnitTest

Result on this branch: 3491 tests, 0 failures.

On an IC-705 (network / WLAN):

  1. Install the debug APK on a phone that can reach the IC-705's Wi-Fi:
    cd ft8af && ./gradlew installDebug (Windows: gradlew.bat installDebug).
  2. In FT8AF, connect to the IC-705 via the settings screen's network
    connection dialog. Confirm the CAT chip goes green.
  3. Turn the VFO on the IC-705 to a new dial (e.g. 14.074 → 14.080 MHz).
  4. Within ~2 s the app's band indicator should follow to the new dial.
    Before this change it stayed on the old dial until reconnect.
  5. Repeat with PTT on during a TX slot: the app should not ask for
    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) — IcomRig is the shared class.

🤖 Generated with Claude Code

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

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.34%. Comparing base (6ab072f) to head (59a1cd5).
⚠️ Report is 8 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            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           
Flag Coverage Δ
android 16.90% <ø> (ø)
native 9.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread ft8af/app/src/main/java/com/k1af/ft8af/rigs/IcomRig.java
Comment thread ft8af/app/src/main/java/com/k1af/ft8af/rigs/IcomRig.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants