Files
app/native-test/fax_line.cpp
Claude 71c649bce1 README as a landing page; D-Modem-RE is now D-Modem; CI skips doc-only changes
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
2026-11-05 10:46:04 +00:00

52 lines
1.5 KiB
C++

/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (C) 2026 Neo-Desktop
*
* fax_line.cpp - D-Modem's modem_test (two modems back to back on
* an audio pipe, a pty for each one's DTE) paced as a
* phone line is: at the sample clock (MODEM_REALTIME,
* as the interop tests have it), so that a fax
* program's T.30 timing meets the line's (modem_test
* runs as fast as it can once off hook). The app's
* fax tests' line.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dsplibs.h>
#include <log.h>
#include "options.h"
#include "line_speed.h"
#include "pipe_modem.h"
/* two modems back to back on pipes at the line's pace, their ptys on stderr, until they end */
int main(int argc, char *argv[])
{
dmd::Options opt;
int pipe1[2], pipe2[2], ret;
dcore::log_level = 1;
dmd::parse_options(argc, argv, opt);
dcore::log_open("test");
prop_dp_init();
if (pipe(pipe1) < 0 || pipe(pipe2) < 0) {
perror("pipe");
return 1;
}
dmd::PipeModem a("modemA", 9600, opt.country, pipe1[0], pipe2[1]);
dmd::PipeModem b("modemB", 9600, opt.country, pipe2[0], pipe1[1]);
/* (unpaced only when asked: MODEM_REALTIME=0) */
line_speed(a);
line_speed(b);
fprintf(stderr, "created modemA: %s\ncreated modemB: %s\n",
a.pty().name(), b.pty().name());
dmd::PipeModem *modems[] = { &a, &b };
ret = dmd::PipeModem::run(modems, 2);
prop_dp_exit();
dcore::log_close();
return ret;
}