From bbce5ca9745d64cd10fff4ff647983d187b6e0c8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 10:28:04 +0000 Subject: [PATCH] docs: rewrite features, settings intro and fonts notes in Simplified Technical English Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRRRR4BV2CBsQMqfrT6 Signed-off-by: Claude --- app/src/main/assets/fonts/README.md | 32 +- docs/features.md | 517 ++++++++++++++++------------ docs/settings.md | 10 +- tools/settings_ref.py | 20 +- 4 files changed, 331 insertions(+), 248 deletions(-) diff --git a/app/src/main/assets/fonts/README.md b/app/src/main/assets/fonts/README.md index 4476b2a..7837c23 100644 --- a/app/src/main/assets/fonts/README.md +++ b/app/src/main/assets/fonts/README.md @@ -13,21 +13,23 @@ | DroidSansMono.ttf | Droid Sans Mono | Apache 2.0 | AOSP `platform/frameworks/base/data/fonts` | The retro terminal types (ANSI-BBS, RIPscrip, Amiga ANSI, the Commodores, -the Atari 8-bit and ST, Viewdata) draw their characters from their machines' -own character ROM fonts, in the shared code (`shared/.../terminal/RomFonts.kt`, -written by `tools/gen_rom_fonts.py`), not from a font file here. The glyphs -are SyncTERM's, from Synchronet's ciolib (`src/conio/allfonts.c`, -LGPL-2.0-or-later, copyright Rob Swindell and contributors; -`licenses/syncterm-fonts-LGPL-2.0.txt`): the IBM VGA's code page 437, -RIPterm's 8x8, the Commodore 64's and 128's, the Atari 8-bit's, the Amiga's -Topaz, Topaz Plus, MicroKnight, MicroKnight Plus, P0T-NOoDLE and mO'sOul, -Prestel's and the Atari ST's. +the Atari 8-bit and ST, Viewdata) do not use a font file from this folder. +They draw their characters from the character ROM fonts of their machines, +in the shared code (`shared/.../terminal/RomFonts.kt`, written by +`tools/gen_rom_fonts.py`). The glyphs come from SyncTERM, from the ciolib of +Synchronet (`src/conio/allfonts.c`, LGPL-2.0-or-later, copyright Rob Swindell +and contributors; `licenses/syncterm-fonts-LGPL-2.0.txt`). These are the +fonts: the code page 437 of the IBM VGA, the 8x8 of RIPterm, the fonts of the +Commodore 64 and 128, the font of the Atari 8-bit, the Topaz, Topaz Plus, +MicroKnight, MicroKnight Plus, P0T-NOoDLE and mO'sOul of the Amiga, and the +fonts of Prestel and the Atari ST. -Which character each code is comes from Rebecca Bettencourt's Legacy -Computing mappings (`mappings/legacy` in kreativekorp/charset), in +The character for each code comes from the Legacy Computing mappings of +Rebecca Bettencourt (`mappings/legacy` in kreativekorp/charset), in `LegacyCharsets.kt` (written by `tools/gen_legacy_charsets.py`). That file -also has Unscii 2.1's `unscii-8` and `unscii-16` (public domain, -http://viznut.fi/unscii/), for the characters a machine's ROM hasn't got -(another model's, such as the Atari XL's international set). +also has `unscii-8` and `unscii-16` of Unscii 2.1 (public domain, +http://viznut.fi/unscii/). These give the characters that the ROM of a +machine does not have (the characters of another model, for example the +international set of the Atari XL). -The licence texts are in `licenses/`; the app shows them (Settings, Font licences). +The licence texts are in `licenses/`. The app shows them (Settings, Font licences). diff --git a/docs/features.md b/docs/features.md index 1a29010..54faf73 100644 --- a/docs/features.md +++ b/docs/features.md @@ -1,222 +1,303 @@ # The app, screen by screen -- **Home**: what the modem is doing (off, ready, connecting, online with - its rates down and up and the call's time) and the one thing to do about - it (set up SIP, start, hang up, stop); the line (the SIP account, - incoming calls, the network, fax); quick dial of the systems last - dialled; the phone (a voice call made or answered, the answering - machine's messages: [voice.md](voice.md)); the terminal and the directory; the modem's console (folded, - with an AT command line). -- **A call ringing in** (SIP, the other phone, a mobile call): the - phone's incoming call notification (heads-up, over the lock screen, - the ringtone) and a popup over the app, with who's calling when the - line says (the other phone's name): Answer (ATA: a fax machine's call - goes to the fax receiver by itself, a modem's to the terminal), or - Ignore (it rings on, out of sight); Answer as fax too when adaptive - answer is off; Answer as a voice call, or Take a message (the - answering machine). Gone when the modem - answers (here, a computer on a bridge, S0) or the caller gives up. -- **Settings**: the SIP account (or paste `user:password@host`, as - dmodemd's `SIP_LOGIN`), taking incoming calls, T.38, the AT commands - sent at start (`ATX3` by default: SIP has no dial tone), the log levels; - the country, from the ITU's list of 192 (D-Modem's, after E.180): - the modem's line settings and how it hears busy, and the call progress - tones the app plays in its tones (a second of dial tone as an entry is - dialled, the ringing tone while the other phone rings, the busy or - congestion tone when a call can't be made), with a button to hear them. - `tools/country_tones.py` makes the shared Kotlin's copy of the table. -- **Terminal**: a VT100/VT220/xterm terminal on the modem (256 and 24-bit - colours, the alternate screen, bracketed paste, DEC line drawing) that - also speaks what BBSes expect: CP437, ANSI.SYS's cursor save/restore and - clear-home, bold as bright, iCE colours, and box drawing and block - characters drawn to fill their cells so ANSI art has no gaps. A - terminal type (Settings, and each directory entry's own) picks what it - is: xterm, ANSI-BBS (a PC's, in CP437, as SyncTERM is), RIPscrip, Avatar, Amiga ANSI, DEC VT52, VT100, - VT102, VT220, VT320, VT340, VT420, VT510, VT520 or VT525, a Commodore, an - Atari 8-bit or ST, Viewdata (Prestel), a Minitel or a Tektronix 4014. Each - answers the device attribute requests as that terminal did, knows only - its own sequences (a VT100 has no colours, a VT220 no xterm titles or - mouse), and gives SSH its `TERM` and Telnet its TERMINAL-TYPE. The DEC - terminals have their double-width and double-height lines, 80/132 - column switching (the screen refits to the width), the VT52's own - sequences and graphics (and a VT100's VT52 mode), the UK character set, - the keyboard LEDs and parameter reports, and a printer port (from the - VT102 on) whose output is saved to a text file. The VT220 and VT320 - add G0-G3 with their locking and single shifts, the national - replacement sets, DEC Supplemental and (VT320) DEC Technical and - Latin-1 as 96-character sets, 8-bit replies (S8C1T), protected - characters with selective erase (DECSCA, DECSED, DECSEL), the - conformance level (DECSCL), the printer, keyboard and user-defined key - status reports, the cursor and tab stop reports (DECCIR, DECTABSR), the - preferred supplemental set, user-defined keys (DECUDK: Shift with - F6-F20), and soft characters (DECDLD: the host's own glyphs, drawn from - its bitmaps). A VT320 also has its status line below the screen: the - cursor's place, or a line the host writes (DECSSDT, DECSASD). The VT420 - adds left and right margins (DECLRMM, DECSLRM), the rectangular area - operations (copy, erase, selective erase, fill, attribute change and - reverse, as a rectangle or a stream, and the checksum), column insert - and delete, back and forward index, six pages (NP, PP, PPA, PPR, PPB), - the lines and columns asked for (DECSNLS, DECSLPP, DECSCPP), and the - keypad and backarrow modes; the VT5xx add the display extent report, - and the VT525 colour, with its colour table (DECAC, DECRQTSR, DECRSTS, - in RGB or DEC's HLS). The VT340 has the graphics: sixel images and - ReGIS (`ESC P p`) in 16 colour registers they share, ReGIS drawing on - an 800x480 screen over the text with its positions (absolute, - relative, the position stack, pixel vectors), vectors, circles, arcs - and curves, filled polygons, text in sizes and directions, the writing - controls (overlay, replace, complement, erase, the colour, patterns, - negative, shading), the screen controls (erase, background, address - mapping, the colour map in HLS or letters), the position and alphabet - reports, loadable alphabets and macrographs. The Tektronix 4014 is its - storage tube on its own (vectors, points, incremental plots and alpha - text in four sizes, the line styles, the beam's place reported, ESC FF - to clear), and xterm and the VT340 have it too as Tek mode (`ESC [ ? 38 - h`, on the alternate screen until `ESC ETX`). The key bar gains the DEC keypad (PF1-PF4, digits, minus, - comma, period, Enter, in numeric or application mode), and on a VT220 - or VT320 the LK201's F6-F20, Find and Select and a page of the - user-defined keys; a hardware numpad sends the keypad's keys. ANSI-BBS is - the PC's 80x25 drawn in the IBM VGA's own 8x16 code page 437, with - SyncTERM's additions: font selection (`ESC [ 0 ; n SP D`, SyncTERM's - font numbers: the C64's, C128's, Atari's, Amiga's, Prestel's and ST's - fonts), ANSI music (`ESC [ |`, and a bare - `ESC [ M` when a PLAY string follows it) played as a PC speaker would, - iCE colours when the BBS asks (`ESC [ ? 33 h`), the line speed it asks - to be shown at for ANSI animations (`ESC [ 0 ; n * r`), and doorway - mode for DOS doors (`ESC [ = 255 h`: the keys as a PC's scan codes). - Avatar is ANSI-BBS with FidoNet's compact codes as well (AVT/0 and - AVT/0+: ^L, ^Y's repeat, ^V's PC attributes, cursor moves, insert mode, - area scrolls, clears and fills, and pattern repeats). RIPscrip (1.54) - is ANSI-BBS whose lines starting `!|` draw on a 640x350 EGA screen over - an 80x43 text window: lines in their styles and thicknesses, - rectangles, bars, circles, ellipses, arcs, pie slices, Béziers, - polygons, flood fills in BGI's patterns or the host's, text, the - palette, viewport and text window, the clipboard, and mouse regions - and buttons that send their text when tapped; it answers `ESC [ !` - with its version. Amiga ANSI is - ANSI-BBS in Latin-1, the Amiga's set, in Topaz (the Amiga's own 8x8), - in colours from the Amiga's palette. The - Commodore types (C64, C128 in 40 or 80 columns, Plus/4, VIC-20, PET in - 40 or 80 columns) speak PETSCII as CCGMS and Novaterm do: the screen - becomes the machine's (40x25, the VIC-20's 22x23) in its palette, drawn - in square cells from the machine's own 8x8 character ROM (the C64's, - or the C128's), with both character sets, the colour and cursor - codes, reverse, and the C128's ESC sequences, line feed, underline and - flash. Typing and pasting are turned into PETSCII (CTRL and C= with a - digit set colours, C= with a letter types its graphic), and the key bar - has RUN/STOP, CLR/HOME, INST/DEL, RVS, F1-F8 and a page of colour keys. - A capture is saved as a `.seq` file, and "Plain text" sends one back - as it is. The Atari 8-bit types (ATASCII, with the graphics set or the - XL's international one) give the screen editor's 40x24 in its blues, - inverse video, its cursor keys wrapping round the screen, CLEAR, EOL, - insert and delete of characters and lines, tabs, the buzzer and ESC to - show a control's character; CTRL with a letter types its graphic and - the key bar's INV key types the next character inverse. The Atari ST - types (80 columns in medium resolution's four colours, or 40 in low - resolution's sixteen) are TOS's VT52 with its additions: the pens (ESC - b, ESC c), reverse, wrap, the cursor saved and hidden, erases to the - screen's and line's start, line insert and delete, and the ST's own - character set. Viewdata is - Prestel's 40x24 of teletext: its attributes take a cell and change the - rest of the row (alpha and mosaic colours, flash, conceal, contiguous - or separated mosaics, hold, new and black background; double height is - drawn single), the 2x3 mosaics drawn from the app's own bitmaps, the - cursor wrapping round the screen, and # (Enter too) as the key that - sends. The Minitel is Teletel's 40x25 with its status row: US - addressing, text and mosaics (SO/SI), SS2's accents and symbols, the - ESC colours and attributes (the background and separation taking - effect at the next space or mosaic), REP, its CSI commands, the - protocol commands (it answers as a Minitel 2), scrolling or page mode, - the 80-column Mixte mode, the Téléinformatique mode as a VT100, and a - key bar of Envoi, Retour, Suite, Répétition, Correction, Sommaire, - Guide, Annulation and Connexion/Fin. Both save captures as `.vdt`. Colour - themes (VGA, xterm, Solarized, Dracula, Monokai, Gruvbox, Nord, green - and amber phosphor), fonts (Cascadia Code, Sauce Code Pro Nerd Font, - Source Code Pro, Roboto Mono, JetBrains Mono, Fira Code, OpenDyslexic - Mono, Inconsolata, Droid Sans Mono or the system's; real bold weights - from the variable fonts, optional ligatures; `app/src/main/assets/fonts`), 80/132/40 fixed columns or pinch to zoom, scrollback - with fling, long-press selection with copy, paste, share and open link, - an extra keys bar (Esc, sticky Ctrl/Alt, Tab, arrows with auto-repeat, - Home/End/PgUp/PgDn, F1-F12), volume keys as font size or Ctrl/Alt, - bell as vibration or flash, full screen, snippets, session capture to a - file (shared to other apps), hang up (+++ with its guard times, ATH), - and Start PPP: once a call is up (dialled and logged in by hand), the - app's PPP takes it, the phone's traffic through it as the internet's - own dial has it (`PppTakeoverTest`). - Files sent and received by ZMODEM, YMODEM, XMODEM(-1K) and Kermit, and - as Intel HEX or Motorola S-records for EPROM programmers, monitors and - boot loaders: a file sent as records (a file of them already, as it is: - S1/S2/S3 by the image's size, Intel's extended addresses past 64 KB), - records received with their checksums checked into the binary image - they hold (gaps 0xFF). Plain text too: a file's bytes sent verbatim, - as if typed (to an editor, a BBS, `cat > file`), and what comes saved - as it is until the line is quiet for 10 s. -- **Dial**: the dialing directory: each system's number (or SIP user), the - AT commands it needs before ATD, its terminal type, character set and backspace; one - tap starts the modem if it is off and dials. -- **Remote logins**: a server reached over the internet instead of the - modem, in a terminal session of its own. On Android a directory entry - connects by SSH, Telnet or rlogin (rlogin: the user's name sent as both - names, the window's size when the server asks). On iOS the Terminal - tab's network button opens the Remote screen: SSH (the server's key - kept the first time it's trusted; a password or the app's private key), - Telnet or rlogin. Telnet and rlogin - are the shared Kotlin's (`org.dmodem.app.net`). -- **SSH** is the same client on every platform, the GUI's on Linux, - Windows and macOS too: libdmodemssh (`native-ssh`), on libssh 0.11 and - its own Mbed TLS (both built from their release tarballs, pinned by - SHA-256). Android loads it through JNI (`NativeSsh.kt`), iOS as the - `DModemSSHNative` XCFramework (`ios/DModemSSH`). Ed25519, ECDSA and RSA - keys, the host's and the user's; password, keyboard-interactive and - key logins, the key OpenSSH's, PEM or PuTTY's .ppk (read by the engine - itself, `native-ssh/src/ppk.c`); an agent's keys (on the desktops an - ssh-agent's socket, or on Windows Pageant or OpenSSH's agent: - `native-ssh/src/agent.c`); on Android and iOS the app's own keys (made here, or OpenSSH's, - PEM or PuTTY's .ppk imported; iOS keeps one, from Files, a .ppk turned - into OpenSSH's form with its passphrase, its public key to copy); on Android port forwards (-L, -R, -D: SOCKS 4/4a/5) - and agent forwarding (-A, each signature asked of the user when the - entry says). Its tests run against a real sshd: `native-ssh/test`, - and the app's JVM tests on a host build of the JNI library - (`./gradlew :app:buildHostSsh`, run by the unit tests). -- **Log**: the modem's and SIP's log (Copy for all of it). -- **AT commands** (Settings, AT commands, and the terminal's menu): the - AT command reference, D-Modem's manual (`docs/at_commands.pdf`, the - A5 edition) in the app (`app/src/main/assets/docs`), its pages shown - in the app with a zoom, or opened in the phone's PDF app for its search - and its contents' links. -- **Back**: from any other tab back to Home; on Home the app goes to the - background (the modem keeps running), as the Home button would. -- **Local Linux** (Settings, Linux): distributions installed and run - under proot, as root in /root, the phone's storage at /sdcard, and the - modem as a serial port at `/dev/ttyDM0` (a pty of the app's, bound in): - `minicom -D /dev/ttyDM0`, pppd, efax and the like work as on a real - modem. The program that opens it has the modem as a serial bridge's - client has it (one at a time, with the TCP, Bluetooth and USB bridges); - closing it drops DTR, so the call hangs up as a serial cable's end - would. `ModemTtyTest`, and `LinuxSystemTest` in a real Alpine under - proot: ATI from the distro, the modem's answer back. - A USB serial adapter plugged into the phone is `/dev/ttyUSB0` there (a - pty of the app's too: Android lets no app's programs at a USB device): - the app opens the adapter when a program opens the port and closes it - (DTR down) when the program does; the speed, stop bits, RTS/CTS and B0's - hang-up follow what the program sets (`stty`, minicom, pppd); a pty keeps - no character size or parity, so it is 8 data bits, no parity. - `SerialTtyTest`. -- **Dial-in** (Settings, Dial-up internet): the phone as an ISP for whoever - calls the modem, on SIP or any other line. A call that rings is answered - (unless the fax settings answer calls already); once it connects, the - modem's DTE is taken and a PPP server on the call gives the caller - 10.64.64.2, DNS at 10.64.64.1 and the phone's network through the same - NAT the serial bridges' internet host uses. When the caller's PPP ends, - or none starts, the app hangs up; when the call drops, PPP stops. Home - shows the caller online, with what has gone each way and a Hang up - button. Tested over two of D-Modem's modems back to back - (`DialInLineTest`: answer, CONNECT 33600, the address, DNS and a ping - through the phone, the hang-up). +- **Home**: Home shows these items: + - The state of the modem (off, ready, connecting, online with its rates + down and up and the time of the call), and the one action for that + state (configure SIP, start, hang up, stop). + - The line (the SIP account, incoming calls, the network, fax). + - Quick dial of the systems that you dialled last. + - The phone (a voice call that you make or answer, and the messages of the + answering machine: [voice.md](voice.md)). + - The terminal and the directory. + - The console of the modem (folded, with an AT command line). +- **An incoming call that rings** (SIP, the other phone, a mobile call): the + app shows the incoming call notification of the phone (heads-up, over the + lock screen, the ringtone). It also shows a popup over the app, with the + name of the caller if the line gives it (the name of the other phone). The + popup has these options: + - Answer (ATA). The call of a fax machine goes to the fax receiver + automatically. The call of a modem goes to the terminal. + - Ignore. The call continues to ring, but the popup closes. + - Answer as fax, if adaptive answer is disabled. + - Answer as a voice call, or Take a message (the answering machine). -The modem runs in a foreground service (`ModemService`) with the CPU and -Wi-Fi kept awake for the call's real-time audio. The SIP user agent binds -to the addresses the phone has when it starts, so the service starts the -modem again when the default network changes (after the call, if one is -in progress). The DNS servers come from the active network: Android has -no `/etc/resolv.conf` for libre to read. + The popup closes when the modem answers (here, a computer on a bridge, or + S0) or when the caller stops the call. +- **Settings**: these items are in Settings: + - The SIP account. You can also paste `user:password@host`, as the + `SIP_LOGIN` of dmodemd. + - The acceptance of incoming calls, T.38, and the log levels. + - The AT commands that the app sends at the start (`ATX3` by default, + because SIP has no dial tone). + - The country, from the ITU list of 192 countries (the list of D-Modem, + after E.180). The country sets the line settings of the modem and how the + modem hears busy. It also sets the call progress tones that the app plays + in its tones: one second of dial tone when you dial an entry, the ringing + tone while the other phone rings, and the busy or congestion tone when a + call fails. A button plays them. `tools/country_tones.py` makes the copy + of the table in the shared Kotlin. +- **Terminal**: a VT100/VT220/xterm terminal on the modem (256 and 24-bit + colours, the alternate screen, bracketed paste, DEC line drawing). It also + accepts the codes that BBSes expect: CP437, the cursor save/restore and + clear-home of ANSI.SYS, bold as bright, and iCE colours. It draws box + drawing and block characters to fill their cells, thus ANSI art has no gaps. + + A terminal type (in Settings, and in each directory entry) sets the type of + the terminal: xterm, ANSI-BBS (the terminal of a PC, in CP437, as SyncTERM + is), RIPscrip, Avatar, Amiga ANSI, DEC VT52, VT100, VT102, VT220, VT320, + VT340, VT420, VT510, VT520 or VT525, a Commodore, an Atari 8-bit or ST, + Viewdata (Prestel), a Minitel or a Tektronix 4014. Each type answers the + device attribute requests as that terminal did. Each type knows only its + own sequences (a VT100 has no colours, a VT220 has no xterm titles or + mouse). Each type gives SSH its `TERM` and Telnet its TERMINAL-TYPE. + + The DEC terminals have these items: their double-width and double-height + lines, 80/132 column switching (the screen fits again to the width), the + sequences and graphics of the VT52 (and the VT52 mode of a VT100), the UK + character set, the keyboard LEDs and parameter reports, and a printer port + (from the VT102). The app saves the output of the printer port to a text + file. + + The VT220 and VT320 add these items: + - G0-G3 with their locking and single shifts. + - The national replacement sets, DEC Supplemental and (VT320) DEC Technical + and Latin-1 as 96-character sets. + - 8-bit replies (S8C1T). + - Protected characters with selective erase (DECSCA, DECSED, DECSEL). + - The conformance level (DECSCL). + - The printer, keyboard and user-defined key status reports. + - The cursor and tab stop reports (DECCIR, DECTABSR). + - The preferred supplemental set. + - User-defined keys (DECUDK: Shift with F6-F20). + - Soft characters (DECDLD: the glyphs of the host, drawn from its bitmaps). + + A VT320 also has its status line below the screen. The line shows the + position of the cursor, or a line that the host writes (DECSSDT, DECSASD). + + The VT420 adds these items: + - Left and right margins (DECLRMM, DECSLRM). + - The rectangular area operations (copy, erase, selective erase, fill, + attribute change and reverse, as a rectangle or a stream, and the + checksum). + - Column insert and delete, and back and forward index. + - Six pages (NP, PP, PPA, PPR, PPB). + - The lines and columns that the host requests (DECSNLS, DECSLPP, DECSCPP). + - The keypad and backarrow modes. + + The VT5xx add the display extent report. The VT525 adds colour, with its + colour table (DECAC, DECRQTSR, DECRSTS, in RGB or the HLS of DEC). + + The VT340 has the graphics: sixel images and ReGIS (`ESC P p`) in 16 colour + registers that they share. ReGIS draws on an 800x480 screen over the text, + with these items: + - Its positions (absolute, relative, the position stack, pixel vectors). + - Vectors, circles, arcs and curves, and filled polygons. + - Text in sizes and directions. + - The writing controls (overlay, replace, complement, erase, the colour, + patterns, negative, shading). + - The screen controls (erase, background, address mapping, the colour map + in HLS or letters). + - The position and alphabet reports, loadable alphabets and macrographs. + + The Tektronix 4014 is its storage tube as a separate type. It has vectors, + points, incremental plots and alpha text in four sizes, the line styles, + the report of the beam position, and ESC FF to clear. xterm and the VT340 + also have it as Tek mode (`ESC [ ? 38 + h`, on the alternate screen until `ESC ETX`). + + The key bar gets the DEC keypad (PF1-PF4, digits, minus, comma, period, + Enter, in numeric or application mode). On a VT220 or VT320, it also gets + the F6-F20, Find and Select of the LK201, and a page of the user-defined + keys. A hardware numpad sends the keys of the keypad. + + ANSI-BBS is the 80x25 of the PC, drawn in the 8x16 code page 437 of the IBM + VGA. It has these SyncTERM additions: + - Font selection (`ESC [ 0 ; n SP D`, with the SyncTERM font numbers: the + fonts of the C64, C128, Atari, Amiga, Prestel and ST). + - ANSI music (`ESC [ |`, and a bare `ESC [ M` if a PLAY string follows it). + The app plays it as a PC speaker does. + - iCE colours when the BBS requests them (`ESC [ ? 33 h`). + - The line speed that the BBS requests for ANSI animations + (`ESC [ 0 ; n * r`). + - Doorway mode for DOS doors (`ESC [ = 255 h`: the keys as the scan codes + of a PC). + + Avatar is ANSI-BBS with the compact codes of FidoNet (AVT/0 and AVT/0+: + ^L, the repeat of ^Y, the PC attributes of ^V, cursor moves, insert mode, + area scrolls, clears and fills, and pattern repeats). + + RIPscrip (1.54) is ANSI-BBS in which the lines that start with `!|` draw on + a 640x350 EGA screen over an 80x43 text window. It draws lines in their + styles and thicknesses, rectangles, bars, circles, ellipses, arcs, pie + slices, Béziers, polygons, flood fills in the patterns of BGI or of the + host, text, the palette, the viewport and the text window, and the + clipboard. It has mouse regions and buttons that send their text when you + tap them. It answers `ESC [ !` with its version. + + Amiga ANSI is ANSI-BBS in Latin-1 (the set of the Amiga), in Topaz (the + 8x8 font of the Amiga), in colours from the palette of the Amiga. + + The Commodore types (C64, C128 in 40 or 80 columns, Plus/4, VIC-20, PET in + 40 or 80 columns) use PETSCII as CCGMS and Novaterm do. The screen becomes + the screen of the machine (40x25, or 22x23 for the VIC-20) in its palette. + The app draws it in square cells from the 8x8 character ROM of the machine + (the ROM of the C64 or of the C128). It has the two character sets, the + colour and cursor codes, reverse, and the ESC sequences, line feed, + underline and flash of the C128. The app changes typed and pasted text into + PETSCII. CTRL and C= with a digit set colours, and C= with a letter types + its graphic. The key bar has RUN/STOP, CLR/HOME, INST/DEL, RVS, F1-F8 and a + page of colour keys. The app saves a capture as a `.seq` file, and "Plain + text" sends it back without change. + + The Atari 8-bit types (ATASCII, with the graphics set or the international + set of the XL) give the 40x24 of the screen editor in its blues. They have + inverse video, cursor keys that wrap round the screen, CLEAR, EOL, insert + and delete of characters and lines, tabs, the buzzer, and ESC to show the + character of a control. CTRL with a letter types its graphic. The INV key + of the key bar types the next character inverse. + + The Atari ST types (80 columns in the four colours of medium resolution, + or 40 columns in the sixteen colours of low resolution) are the VT52 of TOS + with its additions. These are the pens (ESC b, ESC c), reverse, wrap, the + saved and hidden cursor, erases to the start of the screen and of the line, + line insert and delete, and the character set of the ST. + + Viewdata is the 40x24 teletext of Prestel. Its attributes use a cell and + change the remaining part of the row (alpha and mosaic colours, flash, + conceal, contiguous or separated mosaics, hold, new and black background). + The app draws double height as single height. The app draws the 2x3 + mosaics from its own bitmaps. The cursor wraps round the screen. # (and + also Enter) is the key that sends. + + The Minitel is the 40x25 of Teletel with its status row. It has these + items: + - US addressing, text and mosaics (SO/SI), and the accents and symbols of + SS2. + - The ESC colours and attributes (the background and separation change at + the next space or mosaic). + - REP and its CSI commands. + - The protocol commands (it answers as a Minitel 2). + - Scroll mode or page mode. + - The 80-column Mixte mode, and the Téléinformatique mode as a VT100. + - A key bar of Envoi, Retour, Suite, Répétition, Correction, Sommaire, + Guide, Annulation and Connexion/Fin. + + Viewdata and the Minitel save captures as `.vdt`. + + The terminal also has these items: + - Colour themes (VGA, xterm, Solarized, Dracula, Monokai, Gruvbox, Nord, + green and amber phosphor). + - Fonts (Cascadia Code, Sauce Code Pro Nerd Font, Source Code Pro, Roboto + Mono, JetBrains Mono, Fira Code, OpenDyslexic Mono, Inconsolata, Droid + Sans Mono or the font of the system). Real bold weights from the variable + fonts, and optional ligatures (`app/src/main/assets/fonts`). + - 80/132/40 fixed columns, or pinch to zoom. + - Scrollback with fling. + - Long-press selection with copy, paste, share and open link. + - An extra keys bar (Esc, sticky Ctrl/Alt, Tab, arrows with auto-repeat, + Home/End/PgUp/PgDn, F1-F12). + - Volume keys as font size or Ctrl/Alt. + - Bell as vibration or flash. + - Full screen and snippets. + - Session capture to a file (shared to other apps). + - Hang up (+++ with its guard times, ATH). + - Start PPP. When a call is connected (you dialled and logged in + manually), the PPP of the app takes the call. The traffic of the phone + then goes through it, as with the dial of the internet screen + (`PppTakeoverTest`). + + The terminal sends and receives files by ZMODEM, YMODEM, XMODEM(-1K) and + Kermit. It also sends and receives Intel HEX or Motorola S-records for + EPROM programmers, monitors and boot loaders: + - When it sends a file as records, it uses S1/S2/S3 by the size of the + image, and Intel extended addresses above 64 KB. If the file already + contains records, it sends the file without change. + - When it receives records, it checks their checksums and writes the + binary image that they hold (gaps are 0xFF). + + Plain text is also available. The app sends the bytes of a file without + change, as if you typed them (to an editor, a BBS, `cat > file`). It saves + the received data without change until the line is silent for 10 s. +- **Dial**: the dialing directory. Each entry has the number of the system + (or the SIP user), the AT commands that are necessary before ATD, its + terminal type, its character set and its backspace. One tap starts the + modem if it is off, and dials. +- **Remote logins**: a server that the app connects to through the internet, + not through the modem, in a separate terminal session. On Android, a + directory entry connects by SSH, Telnet or rlogin. rlogin sends the user + name as the two names, and the size of the window if the server asks for + it. On iOS, the network button of the Terminal tab opens the Remote screen: + SSH, Telnet or rlogin. For SSH, the app keeps the key of the server the + first time that you trust it, and uses a password or the private key of the + app. Telnet and rlogin come from the shared Kotlin (`org.dmodem.app.net`). +- **SSH** is the same client on all platforms. The GUI also uses it on Linux, + Windows and macOS. It is libdmodemssh (`native-ssh`), on libssh 0.11 and + its own Mbed TLS. Both are built from their release tarballs, pinned by + SHA-256. Android loads it through JNI (`NativeSsh.kt`). iOS loads it as the + `DModemSSHNative` XCFramework (`ios/DModemSSH`). It has these items: + - Ed25519, ECDSA and RSA keys, for the host and the user. + - Password, keyboard-interactive and key logins. The key can be in the + format of OpenSSH, PEM or the .ppk of PuTTY. The engine reads the .ppk + itself (`native-ssh/src/ppk.c`). + - The keys of an agent. On the desktops, this is the socket of an + ssh-agent, or on Windows, Pageant or the agent of OpenSSH + (`native-ssh/src/agent.c`). + - On Android and iOS, the keys of the app. The app can make them, or + import them in the format of OpenSSH, PEM or the .ppk of PuTTY. iOS + keeps one key, from Files. It changes a .ppk into the OpenSSH format + with its passphrase, and shows its public key to copy. + - On Android, port forwards (-L, -R, -D: SOCKS 4/4a/5) and agent + forwarding (-A). If the entry says so, the app asks the user to approve + each signature. + + Its tests run against a real sshd: `native-ssh/test`. The JVM tests of the + app also run on a host build of the JNI library + (`./gradlew :app:buildHostSsh`, which the unit tests run). +- **Log**: the log of the modem and of SIP (Copy copies all of it). +- **AT commands** (Settings, AT commands, and the menu of the terminal): the + AT command reference. This is the manual of D-Modem + (`docs/at_commands.pdf`, the A5 edition) in the app + (`app/src/main/assets/docs`). The app shows its pages with a zoom. You can + also open it in the PDF app of the phone, for its search and the links of + its contents. +- **Back**: from all other tabs, Back goes to Home. On Home, the app goes to + the background (the modem continues to run), as the Home button does. +- **Local Linux** (Settings, Linux): the app installs and runs distributions + under proot. You are root in /root, the storage of the phone is at + /sdcard, and the modem is a serial port at `/dev/ttyDM0` (a pty of the + app, bound in). `minicom -D /dev/ttyDM0`, pppd, efax and similar programs + operate as on a real modem. The program that opens the port has the modem + as the client of a serial bridge has it (one at a time, with the TCP, + Bluetooth and USB bridges). When the program closes the port, the app + drops DTR, thus the call hangs up as at the end of a serial cable. + `ModemTtyTest`, and `LinuxSystemTest` in a real Alpine under proot (ATI + from the distro, and the answer of the modem). + + A USB serial adapter that you connect to the phone is `/dev/ttyUSB0` in + the Linux. This is also a pty of the app, because Android does not let + the programs of an app access a USB device. The app opens the adapter + when a program opens the port. It closes the adapter (DTR down) when the + program closes the port. The speed, stop bits, RTS/CTS and the hang-up of + B0 follow the settings of the program (`stty`, minicom, pppd). A pty + keeps no character size or parity, thus the port uses 8 data bits and no + parity. `SerialTtyTest`. +- **Dial-in** (Settings, Dial-up internet): the phone is an ISP for each + caller of the modem, on SIP or on all other lines. The app answers a call + that rings (unless the fax settings already answer calls). When the call + connects, the app takes the DTE of the modem. A PPP server on the call + gives the caller 10.64.64.2 and DNS at 10.64.64.1. It also gives the + network of the phone, through the same NAT that the internet host of the + serial bridges uses. When the PPP of the caller ends, or if it does not + start, the app hangs up. When the call drops, PPP stops. Home shows the + caller online, with the data in each direction and a Hang up button. We + tested this over two modems of D-Modem back to back (`DialInLineTest`: + answer, CONNECT 33600, the address, DNS and a ping through the phone, the + hang-up). + +The modem runs in a foreground service (`ModemService`). The service keeps +the CPU and Wi-Fi awake for the real-time audio of the call. The SIP user +agent binds to the addresses that the phone has when it starts. Thus, when +the default network changes, the service starts the modem again (after the +call, if a call continues). The DNS servers come from the active network, +because Android has no `/etc/resolv.conf` for libre to read. diff --git a/docs/settings.md b/docs/settings.md index 0f530b2..22046c9 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -2,11 +2,11 @@ # Settings reference -Every setting the apps keep, from their code. [The app, screen by screen](features.md) shows where each is set, and [The modem's line](lines.md) what the lines are. +This page lists each setting that the apps keep, from their code. [The app, screen by screen](features.md) shows where you set each one. [The modem's line](lines.md) tells what the lines are. ## Android -`ModemSettings` ([`ModemSettings.kt`](../app/src/main/java/org/dmodem/app/android/settings/ModemSettings.kt)), kept in the app's private DataStore `modem` under the key beside each. +`ModemSettings` ([`ModemSettings.kt`](../app/src/main/java/org/dmodem/app/android/settings/ModemSettings.kt)). The app keeps each setting in its private DataStore `modem`, under the key in the table. | setting | key | kind | default | what it is | |---|---|---|---|---| @@ -40,11 +40,11 @@ Every setting the apps keep, from their code. [The app, screen by screen](featur | `usbTxGain` | `usb_tx_gain` | number | `0` | A USB modem's line: the modem's sound to it louder or softer, dB (-20 to 20; D-Modem's DMODEM_USB_TX_GAIN). | | `usbTxAuto` | `usb_tx_auto` | on/off | `true` | A USB modem's line: its transmit level set for each call from the remote's answer tone (DMODEM_USB_TX_GAIN=auto), not [usbTxGain]. | -`line` is one of: `bluetooth`, `bt_modem`, `cell`, `none`, `serial_modem`, `sip`, `usb`, `wifi`. +`line` is one of these values: `bluetooth`, `bt_modem`, `cell`, `none`, `serial_modem`, `sip`, `usb`, `wifi`. ## iOS -`ModemSettings` ([`ModemSettings.swift`](../ios/DModemKit/Sources/DModemKit/ModemSettings.swift)), kept as JSON under each setting's own name; the secrets go in the Keychain instead, under the name beside them. +`ModemSettings` ([`ModemSettings.swift`](../ios/DModemKit/Sources/DModemKit/ModemSettings.swift)). The app keeps each setting as JSON, under the name of the setting. But the app keeps the secrets in the Keychain, under the name in the table. | setting | Keychain | kind | default | what it is | |---|---|---|---|---| @@ -78,4 +78,4 @@ Every setting the apps keep, from their code. [The app, screen by screen](featur | `ispScript` | | text | (empty) | As above. | | `ispInit` | | text | (empty) | As above. | -`line` is one of: `sip`, `wifi`, `none`. +`line` is one of these values: `sip`, `wifi`, `none`. diff --git a/tools/settings_ref.py b/tools/settings_ref.py index 0d4ea2b..6118f85 100755 --- a/tools/settings_ref.py +++ b/tools/settings_ref.py @@ -149,12 +149,12 @@ def page(problems): b = ["\n\n", "# Settings reference\n\n", - "Every setting the apps keep, from their code. " - "[The app, screen by screen](features.md) shows where each is set, " - "and [The modem's line](lines.md) what the lines are.\n\n", + "This page lists each setting that the apps keep, from their code. " + "[The app, screen by screen](features.md) shows where you set each one. " + "[The modem's line](lines.md) tells what the lines are.\n\n", "## Android\n\n", - "`ModemSettings` ([`ModemSettings.kt`](../%s)), kept in the app's " - "private DataStore `%s` under the key beside each.\n\n" % (KOTLIN, store), + "`ModemSettings` ([`ModemSettings.kt`](../%s)). The app keeps each " + "setting in its private DataStore `%s`, under the key in the table.\n\n" % (KOTLIN, store), "| setting | key | kind | default | what it is |\n|---|---|---|---|---|\n"] for name, typ, default, doc, first in fs: key = keys.get(name) @@ -163,18 +163,18 @@ def page(problems): b.append("| `%s` | %s | %s | %s | %s |\n" % ( name, "`%s`" % key if key else "", kind(typ, default), cell(show_default(default, consts)), what(doc, first))) - b += ["\n`line` is one of: %s.\n\n" % ", ".join("`%s`" % v.strip('"') for _, v in alines), + b += ["\n`line` is one of these values: %s.\n\n" % ", ".join("`%s`" % v.strip('"') for _, v in alines), "## iOS\n\n", - "`ModemSettings` ([`ModemSettings.swift`](../%s)), kept as JSON " - "under each setting's own name; the secrets go in the Keychain " - "instead, under the name beside them.\n\n" % SWIFT, + "`ModemSettings` ([`ModemSettings.swift`](../%s)). The app keeps " + "each setting as JSON, under the name of the setting. But the app " + "keeps the secrets in the Keychain, under the name in the table.\n\n" % SWIFT, "| setting | Keychain | kind | default | what it is |\n|---|---|---|---|---|\n"] for name, typ, default, doc, first in ifs: default = re.sub(r"^Line\.", "", default) b.append("| `%s` | %s | %s | %s | %s |\n" % ( name, "`%s`" % secrets[name] if name in secrets else "", kind(typ, default), cell(show_default(default, {})), what(doc, first))) - b.append("\n`line` is one of: %s.\n" % ", ".join("`%s`" % l for l in ilines)) + b.append("\n`line` is one of these values: %s.\n" % ", ".join("`%s`" % l for l in ilines)) return "".join(b)