org.ubicollab.service.X10Proxy
Interface X10Proxy

All Known Implementing Classes:
X10ProxyImpl

public interface X10Proxy

A X10 proxy service created for test and demo purpose in UbiCollab. This bundle has a prerequisite: It requires that the Java comm API is installed on the computer it runs on.

Version:
0.1
Author:
Kim-Steve Johansen

Method Summary
 void dimDevice(java.lang.String house, int unit, int cmnd, int percentage)
          Method to send dim or brighten commands to the given X10 device.
 void sendCommand(java.lang.String house, int unit, boolean turnOn)
          Method to send an X10 on/off command to a device with a given address.
 boolean startSerialConnection(java.lang.String comPort)
          Start a serial connection to a CM11A serial X10 controller, on the provided COM port.
 void stopSerialConnection()
          Stop the ongoing serial connection and relase resources used.
 

Method Detail

startSerialConnection

boolean startSerialConnection(java.lang.String comPort)
Start a serial connection to a CM11A serial X10 controller, on the provided COM port.

Parameters:
comPort - the com port to use, e.g. COM1
Returns:
a string describing the connection result.

stopSerialConnection

void stopSerialConnection()
Stop the ongoing serial connection and relase resources used.


sendCommand

void sendCommand(java.lang.String house,
                 int unit,
                 boolean turnOn)
Method to send an X10 on/off command to a device with a given address.

This method assumes that a serial connection to a X10 device already have been started. Nothing will hapen if one does not exist.

Parameters:
turnOn - the turn on
unit - the unit address (1-16)
house - the house address (A-P)

dimDevice

void dimDevice(java.lang.String house,
               int unit,
               int cmnd,
               int percentage)
Method to send dim or brighten commands to the given X10 device.

This method assumes that a serial connection to a X10 device already have been started. Nothing will hapen if one does not exist.

Parameters:
cmnd - Either 0 for dim or 1 for brighten
unit - the unit address (1-16)
house - the house address (A-P)
percentage - the level to change between 1 and 100 (persentage).