com.ferrettronics.device
Class CommPortProxy

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

public class CommPortProxy
extends java.lang.Object
implements DeviceProxy

Implementation of a proxy for a communications port.


Constructor Summary
CommPortProxy(javax.comm.CommPort cp)
          Create a CommPortProxy.
 
Method Summary
 javax.comm.CommPort getCommPort()
          Gets the communications port currently in use.
 void send(byte[] ab)
          Send an array of bytes to the device.
 void send(int b)
          Send a byte to the device.
 void setCommPort(javax.comm.CommPort cp)
          Sets the communications port to write to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommPortProxy

public CommPortProxy(javax.comm.CommPort cp)
Create a CommPortProxy.
Parameters:
cp - Communications Port to write.
Method Detail

send

public void send(byte[] ab)
Send an array of bytes to the device.
Specified by:
send in interface DeviceProxy
Parameters:
ab - The array of bytes to send.

send

public void send(int b)
Send a byte to the device. This method takes an int. Only the eight low-order bits are written to the device.
Specified by:
send in interface DeviceProxy
Parameters:
b - An int containing a byte to be sent.

getCommPort

public javax.comm.CommPort getCommPort()
Gets the communications port currently in use.
Returns:
CommPort The communications port.

setCommPort

public void setCommPort(javax.comm.CommPort cp)
Sets the communications port to write to. Currently only serial ports are supported.
Parameters:
cp - Specifies the communications port.