MODEMU
Initially evaluated as AT commands (before -e option argument is evaluated). Must have an `AT' or `at' prefix.
Dialup tcp connecting
modemu [-c
comm_prog]
[-d
pty_master]
[-e
atcmds]
[-h]
[-s]
[-]
Modemu is a TELNET client with a modem-like user interface. It can redirect its I/O via a pty(4) so that a comm program can handle the pty as a tty with a real modem.
Modemu has two major modes: a command mode and online mode. When invoked, modemu is in the command mode, waiting for AT commands input. Entering a D or O command will put into the online mode, in which modemu communicate with a remote host. Connection closing or a escape command input returns to the command mode.
-c comm_progInvoke a comm program comm_prog. Modemu invokes it by passing /bin/sh an option `-c comm_prog'. Therefore, any sh(1) commands can be specified. The string comm_prog can include a `%s', which will be replaced with the device name of the slave device after removal of the initial "/dev/".
Example:
modemu -c "xc -l %s"
-d pty_masterOpen a file pty_master and talk through it. A named pipe can be a pty_master as well as a pty master device because modemu doesn't ioctl a pty_master.
-e atcmdsExecute a series of AT commands atcmds initially. Atcmds must have an `AT' or `at' prefix. D and O commands in atcmds are ignored.
-h
Print a usage summary.
-s
Print the last two letters of a device name. The device is a pty master device which modemu talks through. Therefore, when modemu prints `p8', comm program must open /dev/ttyp8.
Modemu talks through the standard input/output. (Default)
Note: -c, -d, -s and - options are exclusive each other. If two or more of the options are specified, only the last one is effective.
Command mode expects lines in the following format:
[garbage]at[sp][cmd[sp]]...cr
where at is an `AT' or `at', sp is spaces, cr is a carriage return character (register S3), garbage is a string includes no at. If a `#' prefixes a line, the line is ignored. Available cmds are listed below. They are all case in-sensitive except for some literally used arguments. A (*) marks default settings.
Dialing command. Open a connection to host. If port is specified, modemu attempts to connect with the port instead of the default TELNET port, and doesn't initiate TELNET option negotiation. The following formats are available for str:
Host is an Internet address in numbers-and-dots notation. Optional port is a port number.
Host is an Internet address or host name. Optional port is a port number or service name. The closing double quote can be omitted if no command follows.
Str can be prefixed with `T', `P', `digitW' and/or `digit,'. The prefixes are simply ignored.
Example:
ATDT0W127.0.0.1
ATDP"foo.bar.jp:daytime
E1No operation.
F1No operation.
0]Close the current TELNET session.
Print various information.
Current settings
`&W'ed settings
TELNET option states
Modemu version
0]Return to online mode.
No operation.
0]No operation.
No operation.
V1No operation.
0]No operation.
Set S-register Sn to m. A number from 0-255 is allowed for m.
Print an S-register Sn's value.
Close the current TELNET session, and restore `&W'ed settings.
Save current settings. The saved settings will be lost with the end of the process because they are not stored into NV-RAM nor files.
Control TELNET binary option. Valid values for n are:
Control the local (modemu) option
Control the remote (TELNET server) option
Valid values for m are:
Request non-binary transmission mode (*)
Request binary transmission (8bit through) mode
Disconnect if the request is refused
Example:
Requesting binary mode in remote-to-modemu direction
Requesting binary mode in both remote-to-modemu and modemu-to-remote direction. No use connecting in non-binary mode (using file xfer protocol or something)
Control dial-canceling.
A keypress cancels dialing (*)
Keypresses don't cancel dialing
Control line-mode.
Request character-at-a-time mode (*)
Request line-at-a-time mode (old line-mode). Input characters are buffered and not sent until a CR character is entered.
Quit modemu.
Control raw-mode.
Normal mode (*)
Raw mode. Modemu transmits every octet as received. Applied to both remote-to-modemu and modemu-to-remote direction. Override %B and %L settings.
Control TELNET terminal-type option.
Refuse terminal-type option
Same as %T="$TERM" (TERM environment value is used) (*)
Send term as the terminal-type if remote requests. The closing double quote can be omitted if no command follows.
Control verbose level. %V0 (*) is the quietest, and adding following values to n lets modemu print more information to stderr.
Print misc info to make up for less descriptive ATX0 indication
Print TELNET option negotioation
Modemu recognizes only the following command when in online mode.
Escape to command mode. The `+++' must be input within the guard time. Wait is a period of time longer than the guard time without hitting any key. See also S2 and S12 register descriptions.
Only meaningful registers are listed here. Values in braces are default ones.
S2Escape character code. (43 = `+')
S3Carriage return character code. (13)
S4Line feed character code. (10)
S5Backspace character code. (8)
S7Connecting attempt time limit in seconds. (20)
S12Escape sequence guard time in 50ths of a second. (50)
MODEMU
Initially evaluated as AT commands (before -e option argument is evaluated). Must have an `AT' or `at' prefix.
TERM
See %T1 command description.