com.micheldalal.x10.test
Class X10Test

java.lang.Object
  extended bycom.micheldalal.x10.test.X10Test
All Implemented Interfaces:
com.nevelex.app.args.ArgumentConsumer

public class X10Test
extends java.lang.Object
implements com.nevelex.app.args.ArgumentConsumer

Sample class to show how to use X10 communication stuff.

On Linux, tested with rxtx version 2.0-5.

This particular test program uses the Nevelex Arguments API for command-line argument processing.

Version:
1.0 07/05/2001: Initial Version.,
1.0.1 10/20/2003: Comment updates.
Author:
Michel Dalal

Nested Class Summary
(package private)  class X10Test.HouseCodeArgumentCommand
          Used to specify the house code.
(package private)  class X10Test.PortArgumentCommand
          Command pattern class implementing the Port Argument.
(package private)  class X10Test.RunModeArgumentCommand
          Command pattern class implementing the Run Mode Argument.
(package private)  class X10Test.UnitIDArgumentCommand
          Used to specify the unit id.
 
Field Summary
static java.lang.String LINUX_DEFAULT_PORT
          The default serial port.
static java.lang.String WINDOWS_DEFAULT_PORT
           
 
Constructor Summary
X10Test()
          Constructor for this object just initializes into a house code of 'A', a unit id of 1 and the run mode is unset.
 
Method Summary
 void checkArgumentState()
          The method is called by the ArgumentProcessor after all the arguments have been processed by the application.
 void initArgumentState()
          The method is called by the ArgumentProcessor before any the arguments have been processed by the application.
static void main(java.lang.String[] args)
          Start of the main program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINUX_DEFAULT_PORT

public static final java.lang.String LINUX_DEFAULT_PORT
The default serial port.

See Also:
Constant Field Values

WINDOWS_DEFAULT_PORT

public static final java.lang.String WINDOWS_DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

X10Test

public X10Test()
Constructor for this object just initializes into a house code of 'A', a unit id of 1 and the run mode is unset.

Method Detail

initArgumentState

public void initArgumentState()
                       throws java.lang.IllegalStateException
The method is called by the ArgumentProcessor before any the arguments have been processed by the application. It checks the state of the consumer. If the consumer is not in a valid state, a IllegalStateException will be thrown. This method may be used to register all ArgumentCommands with the ArgumentProcessor.

Specified by:
initArgumentState in interface com.nevelex.app.args.ArgumentConsumer
Throws:
java.lang.IllegalStateException - thrown if the application is not in the desired state.
See Also:
X10Test.PortArgumentCommand, ArgumentProcessor

checkArgumentState

public void checkArgumentState()
                        throws com.nevelex.app.args.MissingArgumentException
The method is called by the ArgumentProcessor after all the arguments have been processed by the application. It checks the state of the consumer. If the consumer is not in a valid state, a MissingArgumentException will be thrown.

Specified by:
checkArgumentState in interface com.nevelex.app.args.ArgumentConsumer
Throws:
com.nevelex.app.args.MissingArgumentException - thrown if the argument list did not contain all the required arguments.

main

public static void main(java.lang.String[] args)
Start of the main program.