Overview  Package   Class  Tree  Index 

be.lassi.lanbox
Class Connection

java.lang.Object
  extended by be.lassi.lanbox.Connection

public class Connection
extends java.lang.Object

The tcp/ip connection to the Lanbox: opens and closes the connection to the Lanbox and provides methods to read and write data to and from the Lanbox.


Constructor Summary
Connection(ConnectionConfiguration configuration, ConnectionStatus status, ConnectionPreferences preferences)
          Constructs a new Lanbox connection.
Connection(ConnectionPreferences preferences)
          Constructs a new Lanbox connection.
Connection(ConnectionStatus status, ConnectionPreferences preferences)
          Constructs a new Lanbox connection.
 
Method Summary
 void close()
          Closes the Lanbox connection.
 void closeConnection()
           
 void incrementErrorCount()
           
 boolean isOpen()
           
 void open()
          Opens the Lanbox connection.
 void openAndWait()
           
 void openConnection()
           
 byte[] read()
           
 byte[] sendReceive(byte[] message)
          Reads response from the Lanbox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection(ConnectionConfiguration configuration,
                  ConnectionStatus status,
                  ConnectionPreferences preferences)
Constructs a new Lanbox connection.

Parameters:
properties - the Lanbox connection properties

Connection

public Connection(ConnectionPreferences preferences)
Constructs a new Lanbox connection.

Parameters:
properties - the Lanbox connection properties

Connection

public Connection(ConnectionStatus status,
                  ConnectionPreferences preferences)
Constructs a new Lanbox connection.

Parameters:
properties - the Lanbox connection properties
Method Detail

close

public void close()
Closes the Lanbox connection.


closeConnection

public void closeConnection()

incrementErrorCount

public void incrementErrorCount()

isOpen

public boolean isOpen()

open

public void open()
Opens the Lanbox connection. Sets the 'open' property to true if the open operation is successful.


openAndWait

public void openAndWait()

openConnection

public void openConnection()

read

public byte[] read()

sendReceive

public byte[] sendReceive(byte[] message)
Reads response from the Lanbox.

Returns:
the reponse from the Lanbox

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2