gnu.io
Class RXTXCommDriver

java.lang.Object
  extended bygnu.io.RXTXCommDriver
All Implemented Interfaces:
CommDriver

public class RXTXCommDriver
extends java.lang.Object
implements CommDriver

Author:
juangui TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
RXTXCommDriver()
           
 
Method Summary
 CommPort getCommPort(java.lang.String portName, int portType)
          getCommPort() will be called by CommPortIdentifier from its open() method.
 void initialize()
          initialize() will be called by the CommPortIdentifier's static initializer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RXTXCommDriver

public RXTXCommDriver()
Method Detail

initialize

public void initialize()
initialize() will be called by the CommPortIdentifier's static initializer. The responsibility of this method is: 1) Ensure that that the hardware is present. 2) Load any required native libraries. 3) Register the port names with the CommPortIdentifier.

Specified by:
initialize in interface CommDriver

getCommPort

public CommPort getCommPort(java.lang.String portName,
                            int portType)
getCommPort() will be called by CommPortIdentifier from its open() method. portName is a string that was registered earlier using the CommPortIdentifier.addPortName() method. getCommPort() returns an object that extends either SerialPort or ParallelPort.

Specified by:
getCommPort in interface CommDriver
Parameters:
portName - - Name of the port
portType - - PORT_SERIAL or PORT_PARALLEL