M o n i t o r X 1 0 |
J e s s e P e t e r s o n |
AddressListener
and a FunctionListener
so that it is able to print out these events as they
occur in the CM11A object that it creates. If provided with a serialized CM11A object,
it is even able to decode macro commands.
The program MonitorX10 can be started by entering the following command line:
java MonitorX10 [-port serial_port] [-serialFile filename]
Where:
-port serial_port Set the serial port that the CM11A can be contacted on. Default: COM2 -serialFile filename Define a filename to read a CM11A serialized object from.
Example
Running MonitorX10 on the default serial port of 'COM2'.
java MonitorX10
Running MonitorX10 on serial port 'COM1'.
java MonitorX10 -port COM1
Running MonitorX10 on the default serial port with a serialized CM11A object.
java MonitorX10 -serialFile cm11a.ser
Running MonitorX10 on the default serial port with a serialized CM11A object on serial port 'COM1'.
java MonitorX10 -port COM1 -serialFile cm11a.ser
Code
The source code for MonitorX10.java
can be found in the samples/MonitorX10 directory. If a serialized CM11A object is specified,
an attempt is made to use it. If unable to use the serialized object or no serialized
object is specified, a new CM11A is created. The program itself implements the
AddressListener
and FunctionListener
Interfaces, so it
registers itself with the CM11A object.
The CM11A object is then allocated. This
establishes the serial connection between the controlling program and the actual CM11A
device. The program then goes to sleep, waiting for X10 events. When an X10 event occurs,
the appriate interface methods are called and the event is printed to the screen.