Commit Graph
21 Commits
Author SHA1 Message Date
Claude 1a467f7ac0 Native builds: D-Modem-RE's usb_wb.cpp (the pico-serial WB stick)
usb_line.cpp now calls into it; without it the JNI library didn't link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-27 23:43:39 +00:00
Claude 9915decc6d Comments for every function: the last batch; CI checks it
The UI tests, Gradle's script, the iOS app and the native test hosts
(batch 6 of 8, comment lines only) and the checker's own. Every
function in the app is now documented; android.yml's docs job runs
tools/doc_check.py first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-27 08:23:54 +00:00
Claude e2b9d1ccfe Agere: on its ROM's own isochronous stream (D-Modem-RE), no patches in the app
D-Modem-RE now streams the Agere modem as Agere's Windows driver does:
alternate setting 1, the ROM's command 0x0c, a packet each way every 2
microframes, nothing downloaded into it. So the app ships no Agere
patches: the agereFirmware assets, installAgereFirmware and its test,
and the bring-up's environment variables go. The transfer counts log an
isochronous IN transfer's packets; the host test checks the alternate
setting and the packets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-26 09:22:48 +00:00
Claude dfc58299ea D-Modem-RE: the Agere's stream state read back after command 0x10, its mode as wIndex if not streaming
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-26 05:39:44 +00:00
Claude b0119dbe5e USB modems: each transfer counted both ways, in the log; the first IN ones' heads
The Agere's samples don't come on the device (its clock stays at 0):
whether its IN transfers never come back, come back failed or come
back empty is now in the log, with the clock every 10 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-26 04:50:35 +00:00
Claude f93ac19dbc Agere USB 2.0 soft modems as the line (D-Modem-RE a30aa39)
D-Modem-RE's third USB line, usb_agere.cpp (047E:2892, 047E:2828), in
the app's native build beside the SmartUSB56's and the pico-serial
Line's. Its ROM patches (D-Modem-RE's firmware/agere: Agere's, under
Agere's licence, with its LICENSE and NOTICE.md) are copied into the
APK's assets at build time (agereFirmware) and installed in the app's
files when an Agere modem is the line, DMODEM_AGERE_FIRMWARE pointing
D-Modem-RE at them. UsbModems knows the two IDs, and runs it at 8000 Hz
(the others at 9600); Android offers the app when one is plugged in;
the line's settings say so.

native-test: agere_host on D-Modem-RE's fake Agere modems
(fake_agere.cpp), their patches the tests' own in a firmware directory:
usb_line_test.py's agere run, ATI3, caller ID, CONNECT 33600 both ways,
data, hang up, unplugged. AgereFirmwareTest: the patches installed as
shipped (D-Modem-RE's SHA-256 sums), the licence beside them.

D-Modem-RE a30aa39 too: V.cvm's MPs through AMR-WB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-26 03:14:40 +00:00
Claude cd97abbf1c Hanging up a ringing SIP call: at once (D-Modem-RE a800759)
D-Modem-RE's core stopped a call hung up while being set up after 48 of
the line's samples, and a SIP call ringing without early media has none:
ATH while it rang waited until the far end gave up. Its fix
(claude/hangup-while-ringing): the stop done on time once no samples
have come for 100 ms.

engine_test's call 5: the engine dials a dmodemd that rings and doesn't
answer, then ATH: the modem back in 0.1 s (it took until the engine was
stopped), the status idle and on hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-25 05:30:50 +00:00
Claude 4e94931656 D-Modem-RE: modern C++ throughout (2ca2a79)
D-Modem-RE's tree in C++17's ways: fixed-width types (u8 .. s64,
include/dm_types.h), std::string and std::vector in place of C strings
and malloc, C++ casts and headers; settings from the environment through
dsp/env.h. Its behaviour unchanged.

For the app: include/ on the include path of its native code and the
host's tests (D-Modem-RE gives it to its own directories alone); the
peer line's Host overrides in the new types (s16 start/stop/speaker,
s32 dte_write, u64 now_ms); t30_line's page callback and bits too.
The host's engine, USB line and C API tests pass, and DModemKit's Swift
tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-25 04:25:20 +00:00
Claude dc9e15aff1 D-Modem-RE: SmartUSB56 caller ID and its extras, SmartDAA, V.22 (7d1790f)
- dmodemd --usb: SmartUSB56 caller ID and the ST75951 silicon DAA; its
  LEDs, wake on ring, handset, international line controls, voice codec,
  RHOM and buzzer (each opt-in).
- SmartDAA (Conexant): its power up, line setup, hook and country table.
- V.22: 1200 bit/s symbols decided around their point.
- Clang preferred where it is installed.

The app says the SmartUSB56 has caller ID now too. The host's USB test
links D-Modem-RE's fake stick alone, without the real libusb behind it:
libusb_get_port_numbers (wake on ring's, unused there) stubbed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-23 23:53:39 +00:00
Claude d353ae2b02 USB modems as the modem's line: SmartUSB56 and pico-serial Line
A new line, "A phone line, through a USB modem": the phone runs the
modem, a Smart Link SmartUSB56 (0483:7554) or a pico-serial Line stick
(1209:0002) plugged into it carries its samples to a real phone line,
with D-Modem-RE's usb_line.cpp as dmodemd --usb drives them (the
stick's caller ID and the country's DAA settings too).

- libusb 1.0.27 (D-Modem-RE's pinned release) built for Android
  (usb/libusb.cmake); usb_line.cpp built with libusb_init,
  libusb_get_device_list and libusb_open renamed to usb_android.cpp's,
  which start libusb without device discovery and give it the
  descriptor Android opened for the app, wrapped, as the only device.
- usb_modem.cpp: the core on that line, the run loop of dmodemd's
  run_line() with a stop pipe and the engine's status; Engine::Config
  usb_fd and usb_rate, through JNI.
- UsbModems: the devices by their IDs, Android's permission asked when
  the modem starts, the connection held while it runs; ModemSettings
  LINE_USB (no SIP account, not a peer line); the settings, Home and the
  notifications say so; Android offers the app when one is plugged in.
- native-test: usb_host (the engine on D-Modem-RE's fake stick, linked
  in as libusb) and usb_line_test.py: two of them through its simulated
  exchange: caller ID, CONNECT 33600, data each way, hang up, unplugged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-22 19:16:22 +00:00
Claude 06e4a41050 No line: the modem started on its own, without a SIP account
A fifth line, "No line (the modem on its own)": the engine starts as on
a peer line (no SIP, no network needed) with nothing behind it. It
answers AT commands in the terminal and on the serial bridges; a dial
gets NO DIALTONE, as a modem with no phone cable plugged in (the
engine's new peer event NO LINE), an answer NO CARRIER.

Home offers "Start without a line" beside "Set up SIP" when there's no
account: the line set to none and the modem started in one tap. iOS has
the same line and button.

Tests: c_api_test (NO LINE: NO DIALTONE), DModemKitTests.testNoLine
(started without an account, a dial NO DIALTONE, commands still
answered), PeerShotsTest.noLine, DashboardShotsTest.firstRun.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-18 23:57:13 +00:00
Claude 34c89ee1e7 codec_line: MODEM_REC records each modem's line (as the V.cvm recording was made)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-18 01:11:38 +00:00
Claude 5f9cce10f1 Tests: shorter calls on the test lines, less needless work
- native-test's line tools (fax_line, codec_line, t30_line) at
  LINE_SPEED times the sample clock (line_speed.h); the fax tests ask
  for 2x (DMODEM_LINE_SPEED, 1 a phone line's pace): 4x leaves the DTE
  a quarter second for what class 1 times in a second, too tight on a
  busy machine
- t30_line's first page some 70 KB in MH, not 220 KB (still two ECM
  blocks)
- the Kermit and lrzsz interop tests' byte traces only when asked
  (KERMIT_TRACE, TRANSFER_TRACE): a file opened for each chunk; Kermit's
  big file 64 KB
- two test JVMs at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 21:05:23 +00:00
Claude 58de26df2e Fax: over T.38 end to end; none on mobile calls
T.38 tested end to end (SipFaxTest): the app's engine dialling dmodemd,
which asks for T.38 a second after it answers, before its CED; the
engine's call progress then waited for a CED that never came on audio.
D-Modem-RE's claude/t38-caller (the submodule here) takes T.38 on a fax
call still waiting for its answer tone as the answer. With ECM and
without, and on audio with T.38 off.

Fax through a mobile call's speech codec doesn't train even at 2400
bit/s (CellFaxTest: AMR-NB 12.2, about a bit in sixteen wrong), so the
app turns fax down on the mobile-call line with why.

The interop test receiving without ECM from D-Modem-RE's T.30 at 12000:
at 14400 a page's row of 1-pel runs comes spoilt the same way each time
on a clean line, before our T.30 (D-Modem-RE's DSP; ECM hides it).
sip_fax_line waits for its dmodemd to end; the README's fax section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 19:30:16 +00:00
Claude 97a816ee45 Fax tests: against D-Modem-RE's own T.30, and over SIP with T.38
native-test's t30_line: a class 1 modem on a line to dsp/t30.cpp's fax
machine (ECM or not, noise if asked); sip_fax_line: the app's engine
dialling a dmodemd over loopback SIP with T.38, each DTE a pty. The
tests (T30InteropTest, SipFaxTest) drive our T.30 on them, skipped
without the programs; FaxLineProcess and Pbm shared among the fax tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 18:48:49 +00:00
Claude fd3e12243d Toward iOS: the engine's C API, an XCFramework build for Apple's systems, its Swift tests
The engine for a program in C or Swift (dmodem_engine.h): started on SIP
or a peer line, its DTE a socket, the log, status, exit, peer line and
speaker as callbacks; native-test's c_api_test drives it (AT commands, a
dial handing the program its line, BUSY, the end).

ios/build-native.sh builds the engine with D-Modem-RE, libre and Mbed
TLS for iOS (devices, simulator) and macOS into DModemEngine.xcframework;
ios/DModemSmoke's Swift tests run it on macOS through the C API. CI
(apple.yml) does both on a macOS runner; android.yml's native job runs
the engine's tests with Apple's fallbacks on Linux too.

D-Modem-RE to its claude/apple-portability branch (portable.h: Apple's
ways where Linux has its own), on top of the speaker hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 13:45:11 +00:00
Claude 7b863948f4 Cellular line: the phone's own mobile calls as the modem's line (privileged app, V.21)
The modem dials and answers on the phone's mobile line: Telecom places,
answers and ends the calls, Telephony tells their state, and Android 13's
call audio interception (CALL_AUDIO_INTERCEPTION, a privileged app's) has
their sound, on PeerLine as another transport (CellTransport): the
handshake made for the call, the exchange's tones played until it is
placed, the call's sound then.

On a rooted phone the app makes itself privileged: a Magisk module with
its APK in /system/priv-app and every privileged permission it asks for
allowed (Settings, Line).

Speech codecs decide the speed: native-test's codec_line puts AMR-NB or
GSM between two modems. AMR 12.2 carries V.21 (300 bit/s); V.22 and
V.22bis connect but lose data half the time; nothing faster connects;
GSM and AMR 4.75 carry nothing reliable. So the line starts at V.21
(+MS), with 1200 and 2400 bit/s to try.

Tests: CellTransportTest (the calls placed, answered, given up),
CellLineTest (two modems on mobile calls, clean and through AMR, on the
phones' audio clock), CellSettingsTest; the settings' screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 10:56:02 +00:00
Claude 32bddae3f5 Modem speaker: hear the dialling, the answer tone and the training on the phone's speaker
As a modem's speaker had the line: on from off hook until CONNECT (ATM1,
the modem's default), all the call with ATM2, never with ATM0, at ATL's
volume; a switch in the settings silences it. The native modem passes
the line's sound (what came, its own at half level) on a socket the
app's player reads, never waiting for it; on SIP calls and on the line
to another phone.

D-Modem-RE to its latest (the V.90/V.92 analogue modem work) with
SipModem::on_speaker() on top (its branch claude/modem-speaker).

Tests: engine_test (SIP: the speaker on until CONNECT, nothing in data
mode, quiet with ATM0), PeerLineTest (the caller's speaker on a call to
another phone), ModemSpeakerTest (the player).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 08:57:09 +00:00
Claude 8608d076e3 Phone-to-phone line: two phones' modems call each other over Wi-Fi or Bluetooth
A line choice beside SIP: another phone running the app, on Wi-Fi (TCP,
found by NSD) or Bluetooth (RFCOMM). The native PeerModem hands the app
its line's samples off hook; PeerLine rings the other phone, carries the
samples both ways as they are and hangs up by closing. The loop runs on
the samples themselves (each side answers every sample, paced to the
sample clock), so nothing is lost and the phones' clocks can't drift:
the modems connect as on a perfect line (V.91, 62666 bit/s).

The calling side plays a dial tone and ringback as an exchange does, so
dialling works with X4 and S7. Busy, no answer and an unreachable phone
give BUSY, NO ANSWER and NO CARRIER.

Tests: peer_host (native-test) runs the engine on a peer line; PeerLineTest
calls between two or three of them over real TCP, through a slow and
uneven link as well. Also a missing alpha in the lights' glow colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 08:27:00 +00:00
Claude 147736235c Fax: T.30 and T.4 on the modem's class 1
The fax machine's side in the app, over the modem's class 1 commands
(T.31): T.4's MH coding of the pages, T.30's procedure (DIS/DCS, the
training and its fallback to lower rates, the pages with MPS/EOP and
their MCF/RTN/RTP, DCN), V.17 to V.27ter as the modem has them.
Tested on D-Modem's own modems back to back (native-test's fax_line,
modem_test paced as a phone line): our sender to our receiver, efax
sending to us and receiving from us, the pages exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-17 00:38:49 +00:00
Claude b56434076a Native library: D-Modem's modem on SIP for Android, with JNI
- external/d-modem-re: D-Modem-RE as a submodule (claude/android-support:
  libdmodem_sip, the modem on a SIP line as a library, cross compiling
  with libre on Mbed TLS).
- app/src/main/cpp: libdmodem_jni.so.  engine.cpp runs dmd::SipModem in
  a thread of its own, its DTE one end of a socket pair whose other end
  is the app's; stop() from any thread, start() again after; the log
  (the modem's and SIP's) and the call's status to callbacks.  jni.cpp
  binds it to com.neodesktop.dmodem.NativeModem (log lines made
  printable ASCII for NewStringUTF: SIP messages come from the network).
- NativeModem.kt: the Kotlin side of the binding.
- native-test: the engine on the build host against a dmodemd over
  loopback SIP.  Passes: dialling out (CONNECT 62666, V.91), data both
  ways, the status online with its rates, a hangup, stop() and a second
  call after start() again, a call coming in (RING, ATA, CONNECT), and
  the app closing its end ending the engine.

Built with NDK r29 for arm64-v8a and x86_64 (android-26).

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