D-Modem's main has its Cadmus2 soft modem in usb_cadmus2.cpp, which
usb_line.cpp now calls: the Android engine and native-test's USB
engines build it, its transfers counted as the others' are. native-test
builds, and its 14 tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSJKSd2kxxKFZAiaXQ
The README, titled for Android only, now introduces the app on Android
and iOS with a short feature list, a quick start, the suite's
repositories and the licence. Its sections move to docs/: the modem's
lines, fax, adapters and phone lines, the app screen by screen, building,
the iOS app and the source layout.
D-Modem-RE becomes D-Modem in comments, docs, workflows and the
generator's header, as in brand's naming guide; the build info line says
'D-Modem core <commit>' for the submodule's commit. Identifiers and the
external/d-modem-re path keep their names.
The Android and Apple workflows no longer run for a change to Markdown,
docs/ or COPYING alone (tag pushes still run).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSqjp9Pn2KBr9N9LAn
D-Modem-RE (D-Modem) updated to its main with the Apple USB Modem's
driver (usb_apple.cpp), built into the engine. UsbModems knows it
(05AC:1401 and 05AC:8220, 9600 Hz), the app is offered when one is
plugged in, and native-test's usb_line_test.py runs calls on its fake
(apple_line).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSpDnDnJUjH5xnnnwz
D-Modem-RE moved dmodemd/ to frontend/dmodemd/ (D-Modem/D-Modem#49).
DMODEM_RE_DMODEMD is that directory, or dmodemd/ in a tree from before
the move, so the submodule can be bumped whenever. Its build directory
is still d-modem-re/dmodemd (the iOS package's library path).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSnYKZ4hXc7DHCsuMA
engine_test.cpp's five calls are now four GoogleTest tests, each with a
dmodemd of its own, and c_api_test.c is c_api_test.cpp, seven tests
(its header still compiled as C, c_api_header.c). ctest registers each
test on its own (gtest_discover_tests). GoogleTest is the system's
(libgtest-dev, added to the native job) or else fetched, v1.14.0 as
D-Modem-RE has it. The USB line tests stay as they were.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSgB6M9Vp9dEP1haEE
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
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
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
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
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
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
- 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
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
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
- 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
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
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
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
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
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
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
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
- 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