|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.manplato.Transport.SLPTransportInterface | +--com.ibm.manplato.Transport.ModemTransport
Modem Communications Transport. This transport, based on the Sun Communications API provides additional connection and configuration methods required for synchronizing through a modem connection. It assumes a modem with a standard response set.
Field Summary | |
protected boolean |
connected
|
protected java.io.DataInputStream |
dis
|
protected java.io.DataOutputStream |
dos
|
protected static int |
fixedSpeed
|
protected java.lang.String |
initString
|
protected boolean |
modemConnected
|
protected javax.comm.CommPortIdentifier |
port
|
protected javax.comm.SerialPort |
ser
|
Fields inherited from class com.ibm.manplato.Transport.SLPTransportInterface |
portName |
Constructor Summary | |
ModemTransport(java.lang.String portName,
java.lang.String init)
Creates a new instance of the ModemTransport class. |
Method Summary | |
void |
close()
Closes the Java COMM API port. |
void |
disconnect()
This method is used to flag that the modem is disconnected. |
protected void |
finalize()
Finalizes this ModemTransport object by closing it's connection. |
void |
flush()
Flushes the input buffer of any remaining data. |
int |
getFixedSpeed()
Returns the fixed serial port speed being used to interface between the host and the modem. |
java.lang.String |
getInitString()
Returns the initialization string being used by this transport. |
static java.lang.String |
getName()
Returns the name of this Transport Interface. |
static java.lang.String[] |
getPortNames()
Returns an array of Strings representing the names of available ports. |
void |
open()
Opens a read/write connection to the implemented transport. |
byte |
readByte()
Read a single byte from the Java COMM API port. |
static void |
setFixedSpeed(int newValue)
Sets the fixed serial speed. |
void |
setInitString(java.lang.String newValue)
Sets the modem init string to use with this transport. |
void |
setSpeed(int speed)
Sets the speed of the underlying Java COMM API port. |
void |
writeBytes(byte[] data)
Writes an array of bytes to the Java COMM API port. |
Methods inherited from class com.ibm.manplato.Transport.SLPTransportInterface |
getSelectedPortName |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected javax.comm.CommPortIdentifier port
protected javax.comm.SerialPort ser
protected java.io.DataInputStream dis
protected java.io.DataOutputStream dos
protected boolean connected
protected boolean modemConnected
protected java.lang.String initString
protected static int fixedSpeed
Constructor Detail |
public ModemTransport(java.lang.String portName, java.lang.String init) throws java.lang.Exception
portName
- the name of the port to open.init
- the modem initialization string. If null, this string defaults to "ATZ".java.lang.Exception
- any exception thrown by the underlying serial handler.Method Detail |
public void close() throws java.lang.Exception
close
in class SLPTransportInterface
java.lang.Exception
- any exception encountered is rethrown.public void disconnect()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
public void flush() throws java.io.IOException
flush
in class SLPTransportInterface
java.io.IOException
- thrown when a problem occurs with flushing the stream.public int getFixedSpeed()
public java.lang.String getInitString()
public static java.lang.String getName()
public static java.lang.String[] getPortNames()
public void open() throws java.lang.Exception
open
in class SLPTransportInterface
java.io.IOException
- thrown when a problem occurs with flushing the stream.public byte readByte()
readByte
in class SLPTransportInterface
public static void setFixedSpeed(int newValue)
newValue
- the serial speed to fix the port to.public void setInitString(java.lang.String newValue)
newValue
- the init string to use with this transport object.public void setSpeed(int speed) throws java.lang.Exception
setSpeed
in class SLPTransportInterface
speed
- The speed to set the transport to.java.io.IOException
- thrown when a problem occurs with flushing the stream.public void writeBytes(byte[] data)
writeBytes
in class SLPTransportInterface
data
- the bytes to be written to the serial port.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |