Commit Graph
3 Commits
Author SHA1 Message Date
Claude 74a9c84cfc Kotlin Multiplatform: shared/, what the Android and iOS apps share, starting with the terminal's emulator
The terminal's VT/xterm emulator, its screen, Sixel, the character sets,
the keys, the characters' widths and the themes move to shared/'s common
Kotlin (the same package: the app's code as it was), their JVM-only calls
in common Kotlin's ways (code points, ISO 8859-1, copyInto, Base64.Mime).
The Android app has its JVM side; iOS its framework, DModemShared (iOS
devices, simulator); Linux native runs the common tests too.

TerminalEmulatorTest in common Kotlin (kotlin.test): on the JVM and
native; XtermFeaturesTest on the JVM. CI: the shared tests on Linux
(JVM, native) and on an iOS simulator (apple.yml).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 13:57:05 +00:00
Claude afa358cecf USB serial: the modem on an adapter plugged into the phone, or on the phone's own USB port (root)
- an adapter (FTDI, CP210x, CH34x, PL2303, CDC-ACM; usb-serial-for-
  android, from JitPack for that alone) as another bridge: its speed and
  format set, its DTR out the modem's carrier (the computer's DCD on a
  null modem), the computer's DTR (its DSR) dropped hanging up; the first
  adapter found, again when one is plugged in; Android offers the app
  when one is (a device filter), its permission asked for
- with root: an ACM function added to the phone's USB gadget in
  configfs, so a computer on the phone's cable sees a modem, served on
  /dev/ttyGS0; taken out again when off; said plainly when the phone's
  kernel can't
- Settings' serial port section has both
Tested: an adapter's port faked (both ways, DCD, DTR's drop hanging up,
unplugged), the gadget on a pty with root faked, its scripts parsed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 07:09:33 +00:00
Claude f97c2a2767 App: Gradle project, the modem's foreground service, SIP settings
- Gradle 9.8.1, AGP 9.4.1 (its built-in Kotlin, 2.4.21), compileSdk 37,
  minSdk 26; the native library built by externalNativeBuild for
  arm64-v8a, armeabi-v7a, x86_64 and x86 (only dmodem_jni, NDK r29), 16 KB
  page aligned; R8 keeps NativeModem's natives and callbacks.
- ModemService: a foreground service (specialUse) that runs the native
  modem with its DTE on DteHub, sends the init commands (ATX3), holds a
  wake lock and a low-latency Wi-Fi lock while on, takes the DNS servers
  from the active network, and starts the modem again when the default
  network changes (after the call in progress); a notification with the
  call's state and Stop.
- DteHub: the modem's DTE shared by any number of listeners (console,
  terminal, bridges), kept across the modem's restarts.
- ModemState: the run state, the call's status, the log and the
  console's text, for the UI and the notification.
- Settings in DataStore: the SIP account (or user:password@host pasted),
  incoming calls, T.38, init commands, country, log levels; no backups
  (the password).
- UI (Compose, Material 3): Modem (start/stop, status, an AT command line
  and the modem's output), Settings, Log.
- Tests: DteHub and the settings (JVM, 5 pass); NativeModemTest
  (instrumented: the library loads, binds, answers AT, ATI3, ATX3, stops,
  and closing the DTE stops it), compiled here, run by CI on an emulator.
- CI: the APK, unit tests and lint; native-test on the runner; the
  instrumented tests on an x86_64 emulator.  The private submodule needs
  a DMODEM_RE_TOKEN secret.

Lint: no issues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-16 15:19:57 +00:00