Skip to content

Promote dev → staging (CAT chip false red, Share logs in About, USB port picker) - #822

Merged
patrickrb merged 10 commits into
stagingfrom
dev
Sep 17, 2026
Merged

patrickrb merged 10 commits into
stagingfrom
dev

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Promotes #818, #819 and #820 to staging.

What's in this promotion

#818: CAT chip no longer turns red while CAT works (#781).

  • Root cause 1, the watchdog armed itself on the app's own frequency push. A rig that takes commands but never answers a frequency read was declared dead about 8 s after connect. setOperationBand now uses BaseRig.setCommandedFreq(), which is not a liveness signal. Only real rig replies arm the watchdog, and USB Diagnostics no longer shows "CAT Response: pass" for a rig that never replied.
  • Root cause 2, a trip was permanent. One missed window (an ATU tune, a menu, a Bluetooth hiccup) left the chip red until the operator tapped it. The new CatLivenessTracker keeps probing after a trip, and the next reply turns the chip back to CONNECTED.
  • Copilot review fix: chip-state writes now happen under the tracker's lock, atomically with the transition that caused them. A reply can no longer heal the chip just before the trip's ERROR is written, which left it red and unrecoverable. A recovery can no longer overwrite a connector error either.
  • Trip and recovery are now logged to debug.log (CAT liveness: …).

#819: Share logs / View logs in Settings → About.

  • The 7-taps-on-version unlock is gone. About now always shows Share logs, which opens the share sheet with debug.log in one tap (or shows a toast when there's no log yet), and View logs, the existing viewer.
  • The saved debug-mode flag and its config hydration are removed; an old debugModeEnabled config row is ignored.
  • The GitHub bug-report body now points to About → Share logs.
  • The new strings are translated in all 17 locales.

#820: Readable USB serial port picker, VID+PID device match, diagnostics hints (#817, partial).

  • Picker rows: they now read Silicon Labs CP2105 · Port 1 of 2 · Enhanced instead of raw hex. When a CP2105 is attached, a hint explains that Yaesu rigs use the Enhanced port for CAT and Kenwood TS-890S/TS-990S use Standard.
  • Device match: the picked device is now matched by VID+PID (then deviceId), not by vendor alone. This fixes an FT-891 (CP2105) plus a Digirig (CP2102) opening the wrong chip.
  • CDC-class rigs now appear in the picker when they have a Communications interface.
  • USB Diagnostics:
    • New "CAT Port" row, e.g. Port 2 of 2 · Standard · 4800 bd.
    • A hint appears when the port is open but CAT is silent.
    • In FT-710 cable mode, CAT Response is an informational row instead of a permanent red.
  • Copilot review fixes:
    • Chip names map driver class literals, so they survive R8 renaming in release builds.
    • Diagnostics counts CDC fallback devices as serial devices.
    • The VID/PID and permission rows describe the connected port's device.
    • Hints are suppressed for Bluetooth/network links and once CAT has answered.
  • Auto-selecting the CAT port and auto-probing baud rates were declined on purpose; the reasoning is in USB CAT: readable serial port picker, VID+PID device match, diagnostics hint (#817) #820.

Testing

🤖 Generated with Claude Code

patrickrb and others added 10 commits September 16, 2026 21:43
Two defects in the CAT liveness watchdog made the status chip go red on a
working link, with no line in debug.log to explain it:

1. The watchdog armed itself on the app's OWN command. setOperationBand
   pushed the target dial through BaseRig.setFreq(), which fires
   onRigResponded() as if the rig had answered. On any rig/transport that
   accepts commands but never answers a frequency read (one-way links,
   write-only CAT modes, adapters that drop replies) the watchdog was armed
   by our write and declared the rig dead 8 s later while PTT and retunes
   kept working. It also made USB Diagnostics report "CAT Response: pass"
   for a rig that had never spoken.

2. A trip was terminal. The watchdog stopped itself on ERROR, so a single
   missed 8 s window (ATU tune, a rig menu, a Bluetooth hiccup, a mangled
   reply) left the chip red until the operator tapped it.

Fix:
- BaseRig.setCommandedFreq(): same bookkeeping as setFreq() but no liveness
  signal; setOperationBand uses it. Only replies parsed from the rig arm the
  watchdog now.
- CatLivenessTracker: the arm/trip/recover state pulled out of MainViewModel
  as a pure class. A trip is a transition; probing continues and the next
  genuine reply flips the chip back to CONNECTED.
- Trip and recovery are written to debug.log so field reports show why.

Tests: CatLivenessTrackerTest (10) covers arming only on replies, one trip
per quiet period, PR #450's TX-edge re-arm, recovery, re-trip, stop/restart.
BaseRigFreqSignalTest (4, Robolectric) pins setFreq vs setCommandedFreq.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sharing debug.log used to need 7 taps on the version text to unlock a hidden
Debug row. About now always shows "Share logs" (opens the share sheet
straight away, or a toast when no log exists yet) and "View logs" (the
existing viewer). The debug-mode flag, its config hydration and the
enabled/disabled toasts are removed.

The share intent is split into internal helpers covered by
DebugLogShareTest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Point the GitHub bug-report body at Settings -> About -> Share logs (the
old Debug row no longer exists), and cover shareDebugLog's success path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Apply chip-state writes under the CatLivenessTracker monitor, atomic with
the transition that caused them: the watchdog's ERROR on trip (written
before the tick's probe goes out), the recovery's CONNECTED, and the
connector's stop+ERROR / stop+afterDisconnect. A reply can no longer heal
between a trip and its ERROR (chip stuck red, tracker untripped), and a
recovery can no longer overwrite a connector error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…by VID+PID (#817)

A Discord user with an FT-891 (Silicon Labs CP2105 dual UART) could not get
CAT working: every row of "Select Serial Port" printed raw hex
(\0x03E9\0x10C4\0xEA70\0x1) so nothing told them which of the two identical
rows was the CAT interface, and when they picked the wrong one the USB
Diagnostics page only said "CAT Response: fail".

The issue proposed auto-selecting the CAT interface from a VID:PID table and
auto-probing ports x baud rates when CAT is silent. Both are deliberately NOT
implemented: on the same 10C4:EA70 chip Yaesu carries CAT on the Enhanced
interface (0) while Kenwood's TS-890S manual says to use the Standard one (1),
so any table keyed on the chip is wrong for someone; and walking baud rates on
the frame-less 5-byte Yaesu protocol can decode garbage as an opcode (0x08 =
PTT on). The app states facts and leaves the choice to the operator.

What changes:

- Picker rows now read "Silicon Labs CP2105 · Port 1 of 2 · Enhanced" /
  "... Port 2 of 2 · Standard" (SerialPortLabel, pure + unit-tested). The
  role is only ever the chip's own interface name, never "CAT"/"PTT". The same
  label feeds the legacy picker and the web log page via information().
- The picker shows a one-line note when a dual-port chip is listed: Yaesu
  uses Enhanced for CAT, Kenwood TS-890S/TS-990S uses Standard.
- CableSerialPort.prepare() and isDevicePresent() match the picked device by
  deviceId+VID+PID, then VID+PID, instead of "last device with this vendor
  id" — an FT-891 plus a Digirig (both Silicon Labs) could open the wrong
  chip depending on HashMap order. The match is logged to debug.log.
- listSerialPorts() lists CDC-class devices that no prober claims (prepare()
  already fell back to CdcAcmSerialDriver for them, so they could connect but
  never appeared) — gated on an actual Communications-class interface so the
  rig's audio codec is not offered as a serial port.
- USB Diagnostics gains a "CAT Port" row ("Port 2 of 2 · Standard · 4800 bd")
  and a hint under the card when the port is open but CAT is silent: the
  Enhanced/Standard note on a dual-port chip, a baud/model note otherwise. In
  FT-710 cable mode (read loop intentionally off) CAT Response is now an
  informational row with a note instead of a permanent red.

Not changed: USB auto-connect still opens the first enumerated port, and a
manual pick is still not persisted (a wrong pick self-heals on restart).

Tests: SerialPortLabelTest, CableSerialPortDeviceMatchTest,
SerialPortPickerHintTest, UsbDiagnosticsLogicTest (+14 cases).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fix CAT chip turning red while CAT still works (#781)
Put Share logs / View logs in Settings > About (no 7-tap unlock)
Resolves the strings_compose.xml conflict: the PR commit had rewritten the
file with CRLF line endings (whole-file conflict). Restored LF and took both
sides' string changes (#817 USB diag/picker strings + #819 share-logs).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Chip names no longer depend on getSimpleName(): R8 renames the driver
  classes in release, so map class literals to stable family keys.
- USB Diagnostics counts a CDC-ACM fallback device (Communications control
  interface) as a serial device, the same rule the picker uses.
- VID/PID/permission rows describe the connected CAT port's device
  (deviceId+VID+PID, then VID+PID after a replug) before the generic ranking.
- CAT hints are suppressed without a USB port or once CAT answered, then pick
  the FT-710 / dual-port / generic explanation.
- FT-710 hint text matches the informational (not red) row.
- UsbDiagnosticsLogicTest back to LF line endings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
USB CAT: readable serial port picker, VID+PID device match, diagnostics hint (#817)
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 49.19355% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.04%. Comparing base (1df9f08) to head (886a50e).
⚠️ Report is 19 commits behind head on staging.

Files with missing lines Patch % Lines
...o/ks3ckc/ft8af/ui/settings/UsbDiagnosticsScreen.kt 62.33% 28 Missing and 1 partial ⚠️
...in/radio/ks3ckc/ft8af/ui/settings/AboutSettings.kt 0.00% 21 Missing ⚠️
...dio/ks3ckc/ft8af/ui/settings/RadioAudioSettings.kt 11.11% 8 Missing ⚠️
...n/radio/ks3ckc/ft8af/ui/settings/DebugLogScreen.kt 70.58% 4 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             staging     #822      +/-   ##
=============================================
+ Coverage      41.94%   42.04%   +0.09%     
  Complexity       239      239              
=============================================
  Files            276      276              
  Lines          33103    33177      +74     
  Branches        3855     3871      +16     
=============================================
+ Hits           13886    13949      +63     
- Misses         18936    18945       +9     
- Partials         281      283       +2     
Flag Coverage Δ
android 17.53% <49.19%> (+0.26%) ⬆️
desktop 63.95% <ø> (ø)
ios 97.71% <ø> (ø)
native 9.93% <ø> (ø)

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

Files with missing lines Coverage Δ
.../radio/ks3ckc/ft8af/ui/settings/BugReportDialog.kt 18.88% <ø> (ø)
...n/radio/ks3ckc/ft8af/ui/settings/BugReportLogic.kt 100.00% <ø> (ø)
...n/radio/ks3ckc/ft8af/ui/settings/DebugLogScreen.kt 13.33% <70.58%> (+13.33%) ⬆️
...dio/ks3ckc/ft8af/ui/settings/RadioAudioSettings.kt 0.26% <11.11%> (+0.13%) ⬆️
...in/radio/ks3ckc/ft8af/ui/settings/AboutSettings.kt 0.00% <0.00%> (ø)
...o/ks3ckc/ft8af/ui/settings/UsbDiagnosticsScreen.kt 55.75% <62.33%> (+4.13%) ⬆️
🚀 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.

@patrickrb
patrickrb merged commit d1d09f2 into staging Sep 17, 2026
38 checks passed
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.

1 participant