[Previous] [Contents] [Next]

qtalk

Talk over communications line (QNX)

Syntax:

qtalk [options] [system]

Options:

-b [baud|data|parity|stop][,...]
Change serial port to this baud, parity, stop bits, and/or data bits. Values of 1-2 are interpreted as stop bits, 7-8 as data bits, none, even, odd, mark and space as parity, all other numbers as baud. Order is not significant e.g. -b 9600,8,n,1
-c hh
Set this as the character (hexadecimal; no leading 0x) that invokes qtalk commands. Default is 01 (Ctrl-A).
-d hh
Replace ASCII rubout with this character (hexadecimal; no leading 0x). Default is 7f.
-D delay
Wait this many 1/20th sec periods before running the command specified by the -x option.

The qtalk utility reads any data emitted by the modem during this delay period and displays the data on your screen before the command is started.

If you use -x without this option, qtalk won't wait to start the command. As a result, if the modem emits any information once qtalk has emitted the dialing string, you have no way of predicting whether qtalk or the command will see that information.

-e
Enable local echo.
-E
(Deprecated) Suppress FF codes (emulates qnxs terminals used in QNX 2). Equivalent to -T qnxs.
-h
Hang up the current modem line if someone dials a new system from within qtalk via the Ctrl-A command. By default, the current modem device is closed but the line isn't dropped.
-l logfile
("el") Log the qtalk session in logfile.
-m modem[,init_string]
The name of the device to use, or the name of a modem pool to choose a device from. If you specify multiple -m options, qtalk will try them, in order, until it finds a device that's not in use.

If you specify an init_string, it will be emitted to the modem before anything else.

If the modem is defined in the modem pool file /etc/config/qtalk.modems, the init_string may be overridden by an init_string defined in the entry for the selected modem. The init_string defined closest to the actual naming of the selected device always supersedes other init_strings (for more information, see the discussion on modem pools).

-o protocol=command
Redefine transfer-protocol options, where protocol is one of the following:
This protocol:  Will do a:
qcp_se qcp send
qcp_re qcp receive
zmodem_se ZMODEM send
zmodem_re ZMODEM receive
other_se other send
other_re other receive
and where command is the command that will perform the file transfer. This command will be run by the Shell. The macro $MODEM will be set to the pathname of the modem device and, in the case of a send, the macro $FILENAME will be set to the filename to be transmitted.

You can disable qtalk's automatic invocation of a protocol by setting command to a null string (""). For example, the following would disable automatic ZMODEM receive:

     qtalk -o zmodem_re=""
For information on default protocol commands or for more information on automatic invocation of protocols, see the section entitled "Invoking qcp and ZMODEM automatically" in the body of the utility description.

The other protocol lets you configure qtalk to use your own commands for sending and receiving files.

-P
Ignore the 8th bit of received characters.
-s system_directory
Instead of $HOME/.qtalk, use this file to look up systems to dial.
-t xfer_protocol
Set the current transfer protocol to qcp, zmodem, or other. (To change the command string that will be run to perform the file transfer, use -o.)
-T terminal_type
Use this terminal emulation for screen output. The terminal type must be one of the following: If you don't specify the -T option, qtalk will leave your console protocol as is.

See also the description of the T command in the Commands section.

-x "command"
Run this command after emitting the dialing string for the named system (see also -D). When the command is run, the MODEM environment variable is set to the pathname of the selected modem device.
system
The name of the system you want qtalk to call. The system must be defined either in $HOME/.qtalk (or the file named by -s) or in the system-wide dialing directory, /etc/config/qtalk. For more information, see the description of the d (dial system) command.

Description:

The qtalk utility lets QNX users communicate with other computers via a serial line that's usually connected to a modem. The destination may be another host computer, in which case qtalk lets you use your computer as a terminal. The qtalk utility also lets two QNX users communicate and transfer files.

The qtalk utility sends any characters you type on the keyboard to the other system via the serial port. Any characters received through the port are displayed. In local echo mode, typed characters are echoed on the display as well as being sent out the serial port.

Configuring default behavior

The qtalk utility lets you to define new defaults for anything that can be specified by command-line options. You define these settings by creating or modifying a system (in the global and/or your personal dialing directory) called defaults. The first thing qtalk does is to look up the defaults dialing entry and process it, before looking at the command-line options that have been supplied. So, the qtalk utility will look for defaults first in $HOME/.qtalk and, if not found there, then in /etc/config/qtalk. This allows new system-wide defaults to be set by a system administrator, while leaving individual users free to create their own default behavior for qtalk.

Command-line options defined in the defaults system are applied before the options specified in the actual command line. Thus you can override the settings in your defaults system with command-line options.


Note: The -s command-line option doesn't change how qtalk searches for the defaults system.

Logging a session

You can log a qtalk session with the -l option:

    qtalk -l /dev/par

or, if you wanted the log to go to the file /tmp/logfile:

    qtalk -l /tmp/logfile

Using the command character

You can use a special command character to set special modes and options while you're within the qtalk environment. This special character defaults to Ctrl-A (^A) unless you change it with the -c option when you invoke qtalk. When you enter the command character, you will be shown some current settings and will be prompted to enter a command. If you enter the command character twice, a single command character is echoed to the modem. This allows you to send the command character to the remote system if you need to.

Replacing the rubout/delete character

You'll find the -d hh option useful when communicating with computers that have a rubout character different from the one you're used to. Many systems use the Backspace key (08 hex) to erase a character. QNX systems default to the ASCII rubout character (7F hex). If you type:

    qtalk -d 08

qtalk will translate your Rubout key into backspace automatically.

Enabling flow control

Using very high-speed modems, or producing a log on slow printers or floppy disks, may cause some characters to be lost. To prevent characters from being lost in these cases, you can enable input flow control prior to invoking qtalk (see stty). This works only if the machine sending the data supports flow control of its output.

Transferring files

The qtalk utility lets you transfer files through either of two methods. You invoke the simpler method with the w (write) and l (log) commands to transfer text files to or from another system. No error checking is performed, however, so you should use this method only when communication lines are good (i.e. direct connect lines or reliable modem connections), or when the other system does not support any of the file transfer methods available from qtalk.

To send a file to a host using write, you should first make the host capable of receiving a stream of text. You could do this with an editor or the cat utility. You can then use the write command to send the file.

To receive a file from a remote host using the l (log) command, first turn on logging to the desired file (with the l command), then enter a command into the remote system to make it display the file (e.g. cat filename on a UNIX type system.)

The second method, involves the s (send) and r (receive) commands, providing access to more sophisticated protocols that include error checking and retransmission when transferring files to other systems.

Invoking qcp and ZMODEM automatically

The qtalk utility attempts to detect qcp and zmodem file transfers when qtalk is on the receiving end. If it detects one of these, qtalk automatically invokes the appropriate receive command for the protocols being used. You can disable this behavior; see the -o option.

When a qcp or zmodem transfer is detected, or when the receive command is given, qtalk will run (through a shell) one of the protocol_re commands.

The corresponding protocol_se commands (to send a file) are invoked only when the send command is given; never automatically.

Here are the default protocol commands:

    qcp_re="qcp $MODEM re"
    qcp_se="qcp $MODEM se $FILENAME"
    zmodem_re="rz <$MODEM >$MODEM"
    zmodem_se="sz $FILENAME <$MODEM >$MODEM"
    other_re=""
    other_se=""

You can't automatically enable the other_re protocol. To invoke other_re or other_se, choose send or receive from the command menu when the current file transfer protocol has been set to other.

Modem pools

The qtalk utility provides a modem pool facility that serves as a shorthand for specifying multiple modems (otherwise done by specifying multiple -m options). For example, if a modem pool named hst was set up which included the modems //1/dev/ser1, //2/dev/ser1, //2/dev/ser2 and //30/dev/ser2, then instead of having to type:

    qtalk -m //1/dev/ser1 -m //2/dev/ser1 -m //2/dev/ser2 -m//30/dev/ser2

you could simply type:

    qtalk -m hst

The qtalk utility tries each device in each pool until it finds a device that's unused (i.e. no other process has the device open). When it finds an unused device, qtalk will do the following, in order:

  1. emit an init_string (if there is one) to the modem
  2. emit a dial string (if there is one)
  3. run the command specified by -x (if -x was specified)
  4. put you in an interactive session with the device

How to define a modem pool

You define modem pools in the /etc/config/qtalk.modems file. Here's the format of this file:

    poolname modem[,init_string]...
    [ <whitespace> modem[,init_string]]...
        ...

where:

poolname
An arbitrary name that identifies a group of modem definitions.
modem
Either the pathname of a modem device (e.g. //3/dev/ser2) or the name of another modem pool (e.g. hst). A modem definition can also include an optional initialization string (init_string).

If modem is a modem device (e.g. //3/dev/ser2) and the entry for that device contains an init_string, qtalk will, upon selecting that device, emit the string to the device and then emit any other communication to the device.

If modem is a modem pool (e.g. hst), qtalk will use the first available modem device in that pool. If the selected modem entry contains an init_string, that string will be emitted. If the selected entry doesn't contain an init_string, but the line that references the modem pool does contain an init_string, that string will be emitted.

You can specify multiple modem definitions, separated by whitespace. You may continue onto the next line by starting it with one or more space or tab characters. If the next line doesn't begin with whitespace, it will be regarded as a new pool definition, not a continuation of the previous one.


Note: If you specify an init_string, you can't insert whitespace between the modem, the comma, and the init_string. Also, if the init_string contains any spaces or tabs, you must enclose it in quotes.

Sample entry

Here's an example entry in the /etc/config/qtalk.modems file:

    hst  //1/dev/ser1 //2/dev/ser1 //2/dev/ser2
         //30/dev/ser2,""

    resethst hst,"^~~~ATZ"

This example defines two pools: one (hst) a simple pool of modems; the other (resethst) a pool that has the same modems but with an init_string of "^~~~ATZ". Note that one modem in the hst pool, //30/dev/ser2, has an empty init_string (i.e. "").

Any modems accessed through the hst pool won't have an init_string emitted to the device. But if those same modems are accessed through a reference to the resethst pool, all but //30/dev/ser2 will have the "^~~~ATZ" init_string emitted to the device.

The presence of the empty init_string ("") ensures that no init_string will be sent to //30/dev/ser2 regardless of whether the modem was accessed via the hst pool or the resethst pool. This happens because the init_string closest in the pool hierarchy to the actual naming of the device always supersedes any other init_strings.

As an alternative to defining the resethst pool, you could either name the "^~~~ATZ" init_string for each modem in the hst pool, or you could specify the init_string with the -m option (-m hst,"^~~~ATZ" does the same as -m resethst).

In init_strings (as well as dialing strings, described below), you can specify any of the following characters; qtalk will act on these characters instead of sending them straight to the modem:

|
send a carriage return
~
delay for 1 second
'
delay for 100 milliseconds
^
drop DTR for 1 second (forces modem to hang up and reset)
!
send a 500-millisecond break
\o
emit a single character represented by o, where o is an octal number of up to three digits
\xhh
same as above, but specified in hex

Interactive commands

To specify any of the following commands, you first press the command character (usually Ctrl-A).

b (break)
Send a break over the modem. You may also send out breaks by pressing the break key (Ctrl-Break on the console keyboard).
C (command character)
Change the command character. You will be prompted to enter the new command character in hex (e.g. 0x02) or as ^char (e.g. ^b).
c (change directory)
If you specify the c command, qtalk prompts you for a new directory name, and will attempt to move to that directory. If qtalk moves successfully to the directory you specify, the directory becomes the current working directory (see the pwd utility) for the duration of qtalk, or until you change directory again. When qtalk terminates, your current working directory reverts to the directory you were in when qtalk was invoked.
d (dial system)
If you specify the d command, qtalk prompts you to enter a system name. It will first look for that name in your own dialing directory ($HOME/.qtalk) and if it doesn't find it there, it will look in the system-wide dialing directory, /etc/config/qtalk.

If you enter a question mark (?) for the system name, you'll see the contents of both dialing directories (if they exist) and you'll be prompted again for a system name. To abort the dialing command and return to normal communications mode, press Enter without entering a name.

Dialing is implemented by looking up the system name -- which can also be specified on the command line when qtalk is invoked -- first in your $HOME/.qtalk file, then in the /etc/config/qtalk file. These files share the same format:

system_name [dialing_string]
[   <whitespace>   command-line_options]
    ...
In these files, you must specify the system name at the very left of the line with no whitespace before it. The dialing string is optional (this string contains commands to be sent to the modem before you're given interactive control). If you specify a dialing string, you must separate it from the system name by spaces or tabs, or both.

In dialing strings, you can specify any of the following characters; qtalk will act on these characters instead of sending them straight to the modem:

|
send a carriage return
~
delay for 1 second
'
delay for 100 milliseconds
^
drop DTR for 1 second (forces modem to hang up and reset)
!
send a 500-millisecond break
\o
emit a single character represented by o, where o is an octal number of up to three digits
\xhh
same as above, but specified in hex
additional lines beneath the line that defines the system name and dialing string may contain additional qtalk command-line options to apply when talking to this system.

If you specify these additional lines, begin each one with at least one tab or space character. Note that a single command-line option can't span multiple lines. You can, however, place just one option per line.

D (delete character)
Change the delete character. You will be prompted to enter the new delete character in hex (e.g. 0x08) or as ^char (e.g. ^h).
e (echo)
If you specify the e command, the local echo feature is toggled. Some systems expect the "terminal" to perform local echoing (half duplex).
h (hang up)
If you specify the h command, the DTR line is lowered for approximately 1/2 a second. This permits modems that support hardware hangup to do so.
l (log)
Begin or end logging of this session. If no log file is open, qtalk asks for the name of a file to log into. If logging is already in progress, it is terminated and the log file is closed. The l command records every character that is sent or received in the log file.

You can use l to take "snapshots" of data from a host computer.

o (modify protocol options)
Prompts you for the protocol whose command string you wish to change (qcp, ZMODEM, other). The current send and receive command strings are displayed and you're then prompted to enter a new command string. To set a string to null, use "". If you don't want to make any changes, press Enter.
p (parity)
Ignore parity (top bit) of received characters. If this option is already set, turn it off.
q (quit with hangup)
This executes a hangup command (see h above) then causes qtalk to exit.
r (invoke a receive)
Invoke the currently selected file transfer protocol to receive a file. Note that qtalk will automatically invoke qcp and ZMODEM if it recognizes a received startup sequence of one of these protocols.
s (send a file)
Send a file, using the currently selected file transfer protocol. This sends a file to another system running the same protocol, which is more reliable than simply writing the file to the modem (see the write command).

When the currently selected protocol is qcp, you can send more than one file by specifying the x=index_file option when qtalk asks for the file to send. This file contains a list of files to send, one per line. You can also specify more than one filename, separated by spaces.

The qcp utility lets you follow the name of the file to send with the name of the destination file. You separate the two filenames with a comma. This is also true for filenames within an index file (option x=). For example:

Send file(s)?  file1  main.c,new_main.c
sends the file file1 as file1 and the file main.c with the name new_main.c. If you don't specify a new name, qtalk creates a file with the same name as the file that is sent.

Files received by qtalk using the qcp protocol have the same attributes and date as the file on the sending machine.

Most transfer protocols require that the modem port be configured for 8-bit data (Use the -b option to set the serial port to 8 data bits; also see the stty command).

T (switch terminal emulation)

The T command lets you switch the terminal emulation used by the console that qtalk is running on. Make sure that the device qtalk is running on supports the specified protocol.

You can specify one of the following terminal types:

This type:  Is useful for:
ansi communicating with systems that support ANSI or VT100 type terminals. It uses ISO Latin-1 supplemental characters (default mode of Dev.ansi console driver).
pcansi communicating with a DOS BBS. This type uses the IBM PC supplemental character set.
qnx communicating between QNX systems.
qnxs communicating with QNX2 systems that have been set up to run with a qnxs terminal.
When you use the T command, you'll be prompted for a terminal type. If you don't wish to set or change the terminal type, simply press Enter.
t (select transfer protocol)
Shows you which protocol is being used (e.g. qcp, ZMODEM) and asks you to select a new one. If you press Enter, no changes are made. This command controls the protocol used when you use the send and receive commands from the command menu.
w (write)
Write a file to the modem. The file is transmitted over the modem, and also echoed on the display if local echo is enabled. The write command doesn't perform any error checking.

You may abort writing to the modem at any time by pressing any key.

x (exit)
Exit from qtalk without performing a hangup. It's good practice to use the q (quit with hangup) command for leaving qtalk, unless you really don't want to perform a hangup.
! (execute a shell command)
This command lets you execute any command from within qtalk. You'll probably find that you'll use the ! command often to:

Note: The ZMODEM utilities rz and sz also implement XMODEM and YMODEM.

Examples:

Call the system "home":

    qtalk home

Communicate with a machine that doesn't echo (half duplex) and expects an ASCII backspace (08 hex) to delete characters.

    qtalk -e -d 08

Communicate with another system and print a hardcopy record.

    qtalk -l /dev/par

Use the /dev/ser2 serial port on node 2.

    qtalk -m //2/dev/ser2

Use the qcp -n option for qcp receives (i.e. receive only files that are newer than existing files).

    qtalk -o qcp_re="qcp $MODEM re -n"

See also:

Dev.ansi, qcp, stty


[Previous] [Contents] [Next]