com.java4less.comm
Class SerialPortConnector
java.lang.Object
|
+--com.java4less.comm.CommConnector
|
+--com.java4less.comm.SerialPortConnector
- Direct Known Subclasses:
- ModemConnector
- public class SerialPortConnector
- extends CommConnector
Utility class to establish a communication with a remote server through a serial port.
- See Also:
CommConnector
Constructor Summary |
SerialPortConnector(java.lang.String portName,
int baudRate,
int dataBits,
int stopBits,
char parity)
|
Method Summary |
void |
close()
Closes communication channel.
|
void |
open()
Opens Communications channel so in & out streams can be used.
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SerialPortConnector
public SerialPortConnector(java.lang.String portName,
int baudRate,
int dataBits,
int stopBits,
char parity)
- Parameters:
portName
- Serial Port Identification Name (OS dependant. e.g. /dev/tty001, COM3 )baudRate
- any supported ratedataBits
- 7 or 8stopBits
- 1 or 2parity
- Odd / Even / Mark / Space / None => O/E/M/S/N
open
public void open()
throws CommException,
java.io.IOException
- Description copied from class:
CommConnector
- Opens Communications channel so in & out streams can be used.
Performs any initializations needed to make channel available.
You will need to configure the comm paramenters,
usually through the subclass constructor's parameters.
- Specified by:
open
in class CommConnector
CommException
java.io.IOException
close
public void close()
- Description copied from class:
CommConnector
- Closes communication channel.
in & out streams are closed and any reserved resources are released.
- Specified by:
close
in class CommConnector