it.m2.net.telnet
Class NVTCom

java.lang.Object
  |
  +--it.m2.net.telnet.Telnet
        |
        +--it.m2.net.telnet.NVT
              |
              +--it.m2.net.telnet.NVTCom

public class NVTCom
extends it.m2.net.telnet.NVT

Network Virtual Telnet Client Base on RFC2217 Permit to use a Serial Line connect a one terminal server compliant with RFC2217. - Tested with sredird 2.1.1


Field Summary
static int FLOW_CTSRTS
           
static int FLOW_NONE
           
static int FLOW_QUERY
           
static int FLOW_XONXOFF
           
 
Fields inherited from class it.m2.net.telnet.Telnet
socket
 
Constructor Summary
NVTCom(java.lang.String host, int port)
          Standard constructor
 
Method Summary
 void addModemChangeListener(NVTListener listener)
           
 int getBaud()
          Return the current baud rate
 boolean getBREAK()
           
 boolean getCTS()
           
 int getDataSize()
           
 boolean getDCD()
           
 boolean getDSR()
           
 boolean getDTR()
           
 int getFlow()
           
 int getModemState()
          Return the current modem state
 java.lang.String getParity()
           
 java.lang.String getPortConfig()
           
 boolean getRI()
           
 boolean getRTS()
           
 java.lang.String getSignature()
          Return the port signature or null if the option is not received
 int getStopSize()
           
 boolean isComSupported()
           
static void main(java.lang.String[] args)
           
 boolean sendInfo()
           
 boolean sendTest()
           
 int setBaud(int baud)
           
 boolean setBREAK(boolean mode)
           
 int setDataSize(int data)
           
protected  void setDefaults()
           
 boolean setDTR(boolean mode)
           
 int setFlow(int flow)
           
 boolean setModemMask(int mask)
           
protected  void setOptions()
           
 java.lang.String setParity(java.lang.String s)
          Set parity
 boolean setRTS(boolean mode)
           
 int setStopSize(int stop)
           
 
Methods inherited from class it.m2.net.telnet.NVT
addReceivedListener, isRunning
 
Methods inherited from class it.m2.net.telnet.Telnet
addLogger, addLogger, addLogger, addOption, close, getInetAddress, getLocalOption, getLogLevel, getReceivedByteCount, getRemoteHost, getRemoteOption, getRemotePort, getSentByteCount, isDo, isLog, isWill, log, log, negotiate, read, read, releaseCpu, sendIAC, sendIAC, sendIACNOP, sendSB, sendSB, sendSB, sendSB, setDoOption, setLogLevel, setSocket, setWillOption, setWillOption, updateReceivedByteCount, updateSentByteCount, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLOW_QUERY

public static final int FLOW_QUERY

FLOW_NONE

public static final int FLOW_NONE

FLOW_XONXOFF

public static final int FLOW_XONXOFF

FLOW_CTSRTS

public static final int FLOW_CTSRTS
Constructor Detail

NVTCom

public NVTCom(java.lang.String host,
              int port)
       throws java.io.IOException
Standard constructor
Parameters:
host - RFC2217 host
port - RFC2217 port
Method Detail

addModemChangeListener

public void addModemChangeListener(NVTListener listener)

setDefaults

protected void setDefaults()
                    throws java.io.IOException
Overrides:
setDefaults in class it.m2.net.telnet.NVT

setOptions

protected void setOptions()
                   throws java.io.IOException
Overrides:
setOptions in class it.m2.net.telnet.NVT

getSignature

public java.lang.String getSignature()
                              throws java.io.IOException
Return the port signature or null if the option is not received

getBaud

public int getBaud()
            throws java.io.IOException
Return the current baud rate

getModemState

public int getModemState()
Return the current modem state

setModemMask

public boolean setModemMask(int mask)
                     throws java.io.IOException

setBaud

public int setBaud(int baud)
            throws java.io.IOException

getDataSize

public int getDataSize()
                throws java.io.IOException

setDataSize

public int setDataSize(int data)
                throws java.io.IOException

getStopSize

public int getStopSize()
                throws java.io.IOException

setStopSize

public int setStopSize(int stop)
                throws java.io.IOException

getParity

public java.lang.String getParity()
                           throws java.io.IOException

setParity

public java.lang.String setParity(java.lang.String s)
                           throws java.io.IOException
Set parity

getFlow

public int getFlow()
            throws java.io.IOException

setFlow

public int setFlow(int flow)
            throws java.io.IOException

getDSR

public boolean getDSR()
               throws java.io.IOException

getDCD

public boolean getDCD()
               throws java.io.IOException

getCTS

public boolean getCTS()
               throws java.io.IOException

getRI

public boolean getRI()
              throws java.io.IOException

getDTR

public boolean getDTR()
               throws java.io.IOException

setDTR

public boolean setDTR(boolean mode)
               throws java.io.IOException

getRTS

public boolean getRTS()
               throws java.io.IOException

setRTS

public boolean setRTS(boolean mode)
               throws java.io.IOException

getBREAK

public boolean getBREAK()
                 throws java.io.IOException

setBREAK

public boolean setBREAK(boolean mode)
                 throws java.io.IOException

getPortConfig

public java.lang.String getPortConfig()
                               throws java.io.IOException

isComSupported

public boolean isComSupported()

sendInfo

public boolean sendInfo()
                 throws java.io.IOException

sendTest

public boolean sendTest()
                 throws java.io.IOException

main

public static void main(java.lang.String[] args)