modemu2k 0.2.2

modemu2k is a Hayes-style AT-command modem emulator that bridges a serial-style interface to a TCP or Telnet endpoint. It ships as a C library (libmodemu2k) exposing the modem state machine, plus a small CLI built on top that allocates a PTY and either reads stdin/stdout directly, forks a comm program (minicom, picocom) on the slave, or accepts an incoming TCP connection as the TTY. IPv4 and IPv6. It is based on modemu, originally developed by Toru Egashira (1995–1996).

Tags telnet library modem emulator utilities bbs communication
License GNU GPL
State stable

Recent Releases

0.2.231 May 2026 04:50 major feature: * Fix pkg-config Cflags so consumers can `#include ` (was forcing the namespaced `` form) * Fix interactive ATZ wiping the -v verbose mask mid-session; add m2k_set_force_verbose / m2k_get_force_verbose public API for hosts that want narration regardless of AT V state
0.2.130 May 2026 00:17 major feature: * Add -v/--verbose flag (CLI). -v previously meant --version, which now requires -V (breaking) * Fix at q to actually quit (regression from v0.2.0) * Ctrl-C twice in CMD mode quits (CMD only; online mode unaffected) * m2k-minicom / m2k-picocom helper scripts forward arbitrary args to modemu2k 2026-05-27 - modemu2k (v0.2.0) * Refactor core into libmodemu2k; public API in modemu2k.h at the project root, with M2K_API visibility markers on every public function and M2K_VERSION_* macros + m2k_version() for header/library skew detection * Add steppable event-loop API (m2k_get_pollfds, m2k_step, m2k_run_done, plus M2K_STATE_DIAL for non-blocking ATD) and embed-mode I/O (m2k_setup_app_io, m2k_write_from_app, m2k_read_to_app) so a host program can run modemu2k inside its own poll/epoll loop with the host supplying the TTY-side bytes * Add curl-style per-context error reporting: m2k_set_error_buffer with M2K_ERROR_BUFFER_SIZE, m2k_strerror, and the M2K_ERR_* codes (including M2K_ERR_AT for rejected AT commands and M2K_ERR_WOULDBLOCK for flow-control retry) * Add m2k_escape, m2k_is_online, m2k_has_carrier, m2k_get_listen_fd, and m2k_set_dtr/_rts (with matching getters) for embed-mode hosts; DTR 1 0 while a connection is live hangs up ( D2-equivalent) * Add TCP listen mode (-l/--listen ) for use as a virtual modem backend (issue #32) * Print --help output and exit when invoked with no arguments; reject conflicting -c/-d/-l/-s combinations at parse time instead of silently honoring the last one * Wrap modemu2k.h declarations in extern "C" guards for C++ consumers * Per-ctx state separation: +++ escape detector, line buffer, and telnet option negotiation tables moved into m2k_t so two coexisting contexts no longer share/clobber each other * Detect POSIX PTY allocation via meson at configure time, fixing PTY setup on macOS and FreeBSD which the previous compile-
0.0.620 Jun 2020 13:05 minor feature: For compiling on gcc-10.
0.0.524 Aug 2019 03:15 minor feature: IPv6 connections can now be made. . To specify a non-standard port, you must use a space now instead of. a colon . Replaced obsolete gethostbyname() with getaddrinfo(). . If the m2k-minicom.sh script is run from the scripts/ directory, it will. use the dev build of modemu2k in src/.
0.0.418 Aug 2019 06:37 minor feature: * Fixed --version output * Added script to invoke minicom: 'm2k-minicom.sh' * Infrastructure to implement testing with `make check` added.