cosmon

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
PTY DEVICES
EXAMPLES
DIAGNOSTICS
DEFAULT VALUES
EXIT VALUES
BUGS
AUTHOR
SEE ALSO

NAME

cosmon − Listen for COS status change messages from an xcat board

SYNOPSIS

cosmon [ options ]

DESCRIPTION

Cosmon listens for COS up or down status change messages from an xcat board installed in a Syntor X radio. The user may specify commands to be executed upon receipt of up or down (or both) status messages. This enables the construction of arbitrary types of control or monitoring applications. Optionally, the program will use a pty device to allow another program to communicate with the xcat board while cosmon is running.

For more information about the xcat board, see http://groups.yahoo.com/group/xcat/. In particular, you will probably need to read the xcat documentation at least once to understand how to use this program.

For copious information on working with Syntor X radios, see http://www.open.org/~blenderm/syntorx/.

For details of the contents of a Syntor X code plug, see http://home.xnet.com/~pakman/syntor/syntorx.htm.

OPTIONS

--upcommand cmd

Cmd specifies the command to execute when COS goes high (i.e. a signal is detected). On Windows, this must be a the full pathname of a EXE or COM program, and may not include arguments. On other machines, it need not be a full pathname as long as the named program may be found in the path, but may include arguments; you will have to enclose multi-word commands in double-quote characters (") to get them to work. The word "UP", the serial port device name and the CI-V address of the xcat board are appended to the command line when the upcommand is executed.

--downcommand cmd

Cmd specifies the command to execute when COS goes low (i.e. signal is lost). On Windows, this must be a the full pathname of a EXE or COM program, and may not include arguments. On other machines, it need not be a full pathname as long as the named program may be found in the path, but may include arguments; you will have to enclose multi-word commands in double-quote characters (") to get them to work. The word "DOWN", the serial port device name and the CI-V address of the xcat board are appended to the command line when the downcommand is executed.

--ptydev devname

Instructs cosmon to listen to devname to allow another program to talk to the xcat board at the same time as cosmon.

This option is not available under Windows.

--windows file

Instructs cosmon to listen to a device name selected by the system in order to allow another program to talk to the xcat board at the same time as cosmon. Cosmon will write the name of the selected file to file.

This option is only available under Windows.

--toaddr civaddr

Set the CI-V address used by the xcat board. The default is 0x20, and the only way to change the board is by hacking on its firmware.

--fromaddr civaddr

Set the CI-V address to be used by cosmon. The default is 0xe0.

--serialport serialdevice

Set to serialdevice the name of the serial device (COM port) on the computer running cosmon to which the xcat is connected.

PTY DEVICES

A pty is a pseudo-terminal device. It allows a program to connect to each of its master and slave sides. To the slave, the pty appears to be a normal terminal (or serial port). Cosmon uses pty devices to allow other programs (like xcatctl ) to issue commands to an xcat board while cosmon continues to monitor the serial stream for COS change messages. On unix systems, ptys take the form of matched pairs of device nodes in /dev, where the master is named /dev/ptyp0 ( p may be any letter, but is traditionally p-s, and 0 may be any letter or digit, but is traditionally a hex digit) and the slave is named /dev/ttyp0 (same rules). Cosmon opens the master device and awaits connections from another program. The other program open the slave device. Note that only one other program may use the pty at any given time.

EXAMPLES

cosmon --upcommand "/usr/local/bin/cosevent"

cosmon --ptydev /dev/ptyz0 --serialport /dev/ttyS0 --downcommand cosdn

cosmon --windows p.dat --serialport /dev/com1 --downcommand C:\EVENT.EXE

DIAGNOSTICS

The program may emit any of the following diagnostic messages:

cosmon: invalid baud rate 19300

You specified a baud rate which is invalid or not supported. The xcat usually runs at 19200; try that.

logic error in dispatcher, index nnn

The program has a bug. Please report what you did to expose it.

cosmon: you must specify at least one of --upcommand or --downcommand

There is no point in running cosmon if you don’t monitor at least one type of COS state change.

Invalid argument (EINVAL)

This error may be caused by several things: selecting an invalid CI-V address, a serial communications problem, a broken xcat board, insufficient data in a code plug you tried to load, or an out-of-range value you tried to set into the xcat and which the program didn’t specifically check for.

No space left on device (ENOSPC)

Indicates a programming error in cosmon.

Connection timed out (ETIMEDOUT)

The xcat board didn’t respond to a command within 30 seconds. This may mean the board isn’t connected, serial parameters are wrong, etc.

Broken pipe (EPIPE)

Data from the xcat was reported to be available, but could not be read by the program. If you see this, something is seriously wrong with your system.

In addition, cosmon may fail for any of the reasons listed in the man pages for the open(2), tcgetattr(2), cfsetispeed(2), cfsetospeed(2), tcsetattr(2), write(2), select(2), or read(2), man pages.

DEFAULT VALUES

The default serial port is /dev/ttyS0.

The default CI-V address for the xcat is 0x20. The default address for cosmon is 0xe0.

EXIT VALUES

Cosmon does not exit normally; it runs until an error occurs, or it is killed. Most errors cause it to return the standard system error code related to the problem. Specifically, invalid parameters in most cases result in an exit status of 22; timeouts result in 110.

BUGS

Doubtless there are many.

AUTHOR

Dennis Boone <jm-sxg at yagi.h-net.msu.edu>

SEE ALSO

loadplug(1), syntorxgen(1)