com.ferrettronics.device
Class Ft649

java.lang.Object
  |
  +--com.ferrettronics.device.Ft649

public class Ft649
extends java.lang.Object

Sends commands to a Ft649 chip. The Ft649 routes commands to up to five other chips.


Field Summary
static int PIN_OFF
          Constant to set a pin off.
static int PIN_ON
          Constant to set a pin on.
 
Constructor Summary
Ft649()
          Create an Ft649.
 
Method Summary
 void accept(byte[] ab, int pin)
          Accept some bytes from a sending device, and forward them on though the proxy to the 649's parent receiving device.
 void connectTo(javax.comm.CommPort cp)
          Connect to a communications port device.
 int getPin()
          Gets the 649 pin attaching this device to the 649.
 void setPin(int p)
          Sets the 649 pin attaching this device to the 649.
 void setPinState(int p, int s)
          Sets the state of a pin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PIN_ON

public static final int PIN_ON
Constant to set a pin on.

PIN_OFF

public static final int PIN_OFF
Constant to set a pin off.
Constructor Detail

Ft649

public Ft649()
      throws java.lang.Exception
Create an Ft649.
Method Detail

connectTo

public void connectTo(javax.comm.CommPort cp)
Connect to a communications port device. param cp The communications port.

accept

public void accept(byte[] ab,
                   int pin)
Accept some bytes from a sending device, and forward them on though the proxy to the 649's parent receiving device.
Parameters:
ab - The array of bytes to accept.
pin - The pin the array of bytes came from.

getPin

public int getPin()
Gets the 649 pin attaching this device to the 649.
Returns:
int The pin.

setPin

public void setPin(int p)
Sets the 649 pin attaching this device to the 649.
Parameters:
p - Specifies the pin.

setPinState

public void setPinState(int p,
                        int s)
                 throws java.lang.Exception
Sets the state of a pin. This does not affect which pin is active. It is a feature of the 649 that allows you to attach simple devices like LEDs and turn them on or off, rather than using it as a router for devices like 639s and 649s. Pin must be greater than or equal to 0 and less than 5 or an exception is thrown. State must either be Ft649.PIN_ON or Ft649.PIN_OFF or an exception is thrown
Parameters:
p - Specifies which pin ( 1 to 5 ).
s - Specifies the state to put the pin in.