freebsd-dev/libexec/xtend/xtend.8

180 lines
5.5 KiB
Groff
Raw Normal View History

1994-10-22 09:53:33 +00:00
.\" Copyright (c) 1992, 1993 Eugene W. Stark
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Eugene W. Stark.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY EUGENE W. STARK (THE AUTHOR) ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
1999-08-28 00:22:10 +00:00
.\" $FreeBSD$
1996-09-22 21:56:57 +00:00
.\"
.Dd October 30, 1993
1994-10-22 09:53:33 +00:00
.Dt XTEND 8
.Os FreeBSD
1994-10-22 09:53:33 +00:00
.Sh NAME
.Nm xtend
.Nd X-10 daemon
.Sh SYNOPSIS
.Nm /usr/libexec/xtend
1994-10-22 09:53:33 +00:00
.Sh DESCRIPTION
.Nm Xtend
interfaces between user-level programs and the TW523 X-10 controller.
It logs all packets received from the TW523, attempts to track the
status of all X-10 devices, and accepts socket connections from user-level
client programs that need to manipulate X-10 devices.
.Pp
When
.Nm
1994-10-22 09:53:33 +00:00
is started, it forks, releases the controlling terminal, then opens
its log file, where it subsequently records all X-10 activity and
diagnostic messages. It then begins processing packets received from
the TW523 and accepting connections one at a time from clients
wishing to issue X-10 commands.
.Nm Xtend
is started from
.Pa /etc/rc.i386
startup script if enabled in
.Pa /etc/rc.conf
script.
1994-10-22 09:53:33 +00:00
.Pp
Sending
.Nm
2000-12-20 13:26:01 +00:00
a
.Dv SIGHUP
causes it to close and reopen its log file. This is useful
1994-10-22 09:53:33 +00:00
in shell scripts that rotate the log files to keep them from growing
indefinitely.
If
.Nm
2000-12-20 13:26:01 +00:00
receives a
.Dv SIGTERM ,
it shuts down gracefully and exits.
A
.Dv SIGPIPE
causes
.Nm
1994-10-22 09:53:33 +00:00
to abort the current client connection.
.Pp
.Nm Xtend
communicates with client processes by a simple protocol in which a one-line
command is sent by the client, and is acknowledged by a one-line response
from the daemon.
.Pp
.Nm Xtend
2000-12-20 13:26:01 +00:00
understands four types of commands:
.Bl -tag -width "monitor H U
.It Ic status Ar H U
where
.Ar H
is a single letter house code, and
.Ar U
is a numeric unit code,
1994-10-22 09:53:33 +00:00
causes
.Nm
1994-10-22 09:53:33 +00:00
to respond with one line of status information about the specified device.
2000-12-20 13:26:01 +00:00
.It Ic send Ar H U N
where
.Ar H
is a single-letter house code,
.Ar U
is either a numeric unit code
1994-10-22 09:53:33 +00:00
or a function code (see source file
2000-12-20 13:26:01 +00:00
.Pa xtend/packet.c )
for a list, and
.Ar N
is a number indicating the number of times (usually 2)
1994-10-22 09:53:33 +00:00
the packet is to be transmitted without gaps,
causes
.Nm
1994-10-22 09:53:33 +00:00
to perform the specified X-10 transmission. If the transmission was apparently
successful, a single-line response containing
2000-12-20 13:26:01 +00:00
.Sy OK
1994-10-22 09:53:33 +00:00
is issued, otherwise a single-line response containing
2000-12-20 13:26:01 +00:00
.Sy ERROR
1994-10-22 09:53:33 +00:00
is produced.
2000-12-20 13:26:01 +00:00
.It Ic dump
1994-10-22 09:53:33 +00:00
causes
.Nm
to dump the current status of all devices to an
.Tn ASCII
file in the spool
1994-10-22 09:53:33 +00:00
directory. The response
2000-12-20 13:26:01 +00:00
.Sy OK
1994-10-22 09:53:33 +00:00
is issued, regardless of whether the status dump was successful.
2000-12-20 13:26:01 +00:00
.It Ic monitor Ar H U
1994-10-22 09:53:33 +00:00
causes
.Nm
1994-10-22 09:53:33 +00:00
to add the current client socket connection to a list of clients that are to
be notified about activity concerning the specified X-10 device.
The single-line acknowledgement
2000-12-20 13:26:01 +00:00
.Sy OK
1994-10-22 09:53:33 +00:00
is returned if the maximum (currently 5) number of such clients was not
exceeded, otherwise
2000-12-20 13:26:01 +00:00
.Sy ERROR
1994-10-22 09:53:33 +00:00
is returned.
.Nm Xtend
then returns to its normal mode of accepting connections from clients.
However, each subsequent change in the status of the specified device will
cause
.Nm
1994-10-22 09:53:33 +00:00
to write one line of status information for the device (in the same
format as produced by the
2000-12-20 13:26:01 +00:00
.Ic status
1994-10-22 09:53:33 +00:00
command) to the saved socket. This feature is useful for writing programs
that need to monitor the activity of devices, like motion detectors, that can
perform X-10 transmissions.
2000-12-20 13:26:01 +00:00
.El
1994-10-22 09:53:33 +00:00
.Sh OPTIONS
None.
.Sh SEE ALSO
1996-09-23 22:24:39 +00:00
.Xr xten 1 ,
1994-10-22 09:53:33 +00:00
.Xr tw 4
.Sh FILES
2000-12-20 13:26:01 +00:00
.Bl -tag -width /var/spool/xten/status.out -compact
1994-10-22 09:53:33 +00:00
.It Pa /dev/tw0
the TW523 special file
.It Pa /var/run/tw523
socket for client connections
.It Pa /var/run/xtend.pid
pid file
.It Pa /var/spool/xten/Log
log file
.It Pa /var/spool/xten/Status
device status file (binary)
.It Pa /var/spool/xten/status.out
.Tn ASCII
dump of device status
1994-10-22 09:53:33 +00:00
.El
.Sh BUGS
There is currently no timeout on client socket connections, so a hung
client program can prevent other clients from accessing the daemon.
.Pp
.Nm Xtend
does the best it can at trying to track device status, but there is
usually no way it can tell when a device has been operated manually.
This is due to the fact that most X-10 devices are not able to
respond to queries about their status.
.Sh AUTHORS
.An Eugene W. Stark Aq stark@cs.sunysb.edu