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-02-15 08:34:14 +00:00
|
|
|
.\" $Id: xtend.8,v 1.9 1998/03/19 07:37:36 charnier Exp $
|
1996-09-22 21:56:57 +00:00
|
|
|
.\"
|
1994-10-22 09:53:33 +00:00
|
|
|
.Th XTEND 8 "30 Oct 1993"
|
|
|
|
.Dd Oct 30, 1993
|
|
|
|
.Dt XTEND 8
|
1999-02-15 08:34:14 +00:00
|
|
|
.Os FreeBSD
|
1994-10-22 09:53:33 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm xtend
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
1997-12-04 07:25:19 +00:00
|
|
|
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
|
1997-12-04 07:25:19 +00:00
|
|
|
.Nm
|
1994-10-22 09:53:33 +00:00
|
|
|
a SIGHUP causes it to close and reopen its log file. This is useful
|
|
|
|
in shell scripts that rotate the log files to keep them from growing
|
|
|
|
indefinitely.
|
|
|
|
If
|
1997-12-04 07:25:19 +00:00
|
|
|
.Nm
|
1994-10-22 09:53:33 +00:00
|
|
|
receives a SIGTERM, it shuts down gracefully and exits.
|
|
|
|
A SIGPIPE causes
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
1997-12-04 07:25:19 +00:00
|
|
|
understands four types of commands. The command:
|
1994-10-22 09:53:33 +00:00
|
|
|
.Bl -tag
|
|
|
|
.It status H U
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
where H is a single letter house code, and U is a numeric unit code,
|
|
|
|
causes
|
1997-12-04 07:25:19 +00:00
|
|
|
.Nm
|
1994-10-22 09:53:33 +00:00
|
|
|
to respond with one line of status information about the specified device.
|
1997-12-04 07:25:19 +00:00
|
|
|
The command:
|
1994-10-22 09:53:33 +00:00
|
|
|
.Bl -tag
|
|
|
|
.It send H U N
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
where H is a single-letter house code, U is either a numeric unit code
|
|
|
|
or a function code (see source file
|
|
|
|
.Pa xtend/packet.c
|
|
|
|
) for a list, and N is a number indicating the number of times (usually 2)
|
|
|
|
the packet is to be transmitted without gaps,
|
|
|
|
causes
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
|
|
|
.B
|
|
|
|
OK
|
|
|
|
is issued, otherwise a single-line response containing
|
|
|
|
.B
|
|
|
|
ERROR
|
|
|
|
is produced.
|
1997-12-04 07:25:19 +00:00
|
|
|
The command:
|
1994-10-22 09:53:33 +00:00
|
|
|
.Bl -tag
|
|
|
|
.It dump
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
causes
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
|
|
|
.B
|
|
|
|
OK
|
|
|
|
is issued, regardless of whether the status dump was successful.
|
1997-12-04 07:25:19 +00:00
|
|
|
The command:
|
1994-10-22 09:53:33 +00:00
|
|
|
.Bl -tag
|
|
|
|
.It monitor H U
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
causes
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
|
|
|
.B
|
|
|
|
OK
|
|
|
|
is returned if the maximum (currently 5) number of such clients was not
|
|
|
|
exceeded, otherwise
|
|
|
|
.B
|
|
|
|
ERROR
|
|
|
|
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
|
1997-12-04 07:25:19 +00:00
|
|
|
.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
|
|
|
|
.B
|
|
|
|
status
|
|
|
|
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.
|
|
|
|
.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
|
|
|
|
.Bl -tag -width /var/spool/xten/Status -compact
|
|
|
|
.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)
|
1997-06-24 03:52:15 +00:00
|
|
|
.It Pa /var/spool/xten/status.out
|
1997-12-04 07:25:19 +00:00
|
|
|
.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.
|
1998-03-19 07:37:43 +00:00
|
|
|
.Sh AUTHORS
|
1997-12-04 07:25:19 +00:00
|
|
|
.An Eugene W. Stark Aq stark@cs.sunysb.edu
|