mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
- 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
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* Copyright (C) 2026 Neo-Desktop
|
|
*
|
|
* fax_line.cpp - D-Modem-RE'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"
|
|
|
|
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;
|
|
}
|