|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jSyncManager.JSerial.SerialPeer
A class to define native code headers for accessing a serial port in Java. This class will provide the native code headers for accessing serial ports under Java. Note that normally a programmer should not directly utilize this class - all functionality is available through the org.jSyncManager.JSerialInterface class.
Field Summary | |
static java.lang.String |
NOPORT
|
static java.lang.String |
PORTUNAVAILABLE
|
Constructor Summary | |
SerialPeer(byte port)
The peer constructor. |
Method Summary | |
boolean |
checkPort(byte port)
A method to check if the requested port exists on this machine. |
int |
getChar()
Gets the next available character from the incoming serial stream. |
int |
getDataBits()
A method to retreive the current databit setting. |
boolean |
getDSRDTRState()
Queries the state of the DSR/DTR handshaking. |
int |
getParity()
A method to retreive the current parity setting. |
static java.lang.String |
getPlatformName()
A static method to return the name of the platform for which a working native code library has been installed. |
byte |
getPort()
A method to return the ID value of the current port. |
boolean |
getRTSCTSState()
Queries the state of the RTS/CTS handshaking. |
int |
getSpeed()
A method to get the currently set serial speed. |
int |
getStopBits()
A method to retreive the current stopbit setting. |
static java.lang.String |
getVersion()
A static method to return the version number of the installed native code implementation. |
boolean |
getXONXOFFState()
Queries the state of the XON/XOFF handshaking. |
void |
grabPort()
Native method to gain exclusive access to a serial port. |
boolean |
portStatus()
A method to determine wether or not the current port is in the "grabbed" state. |
void |
putChar(int b)
Puts a character into the outgoing serial stream. |
void |
releasePort()
A method to release control of the serial port to the underlying OS. |
void |
setDataBits(int databits)
Sets the number of Data Bits per transmission byte. |
void |
setDSRDTR(boolean state)
A method to set the state of the DSR/DTR handshaking. |
void |
setParity(int parity)
Sets the Parity bit type used for each transmission unit. |
void |
setRTSCTS(boolean state)
A method to set the state of the RTS/CTS handshaking. |
void |
setSpeed(int speed)
Native method to set the speed for the serial port. |
void |
setStopBits(int stopbits)
Sets the number of Stop Bits per transmission unit. |
void |
setXONXOFF(boolean state)
A method to set the state of the XON/XOFF handshaking. |
void |
startBreak()
Starts transmitting a break signal. |
void |
stopBreak()
Stop transmission of a break signal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String NOPORT
public static final java.lang.String PORTUNAVAILABLE
Constructor Detail |
public SerialPeer(byte port) throws SerialInitializationException
port
- the port ID number for this serial peer.
SerialInitializationException
- thrown if the port requested does not exist.Method Detail |
public void grabPort() throws SerialGrabException
SerialGrabException
- thrown if the port cannot be grabbed by this process.public void setSpeed(int speed) throws SerialSpeedException
speed
- a valid speed setting.
SerialSpeedException
- thrown if the given speed is invalid, or not supported.public void setDataBits(int databits) throws SerialDataBitException
databits
- the desired number of data bits per transmission byte.
SerialDataBitException
- thrown if the specified value is invalid or unsupported.public void setParity(int parity) throws SerialParityException
parity
- a value representing the parity type.
SerialParityException
- thrown if the given parity is invalid or unsupported.public void setStopBits(int stopbits) throws SerialStopBitException
stopbits
- the number of stop bits per transmission unit.
SerialStopBitException
- thrown if the value specified is invalid or unsupported.public int getChar() throws java.io.IOException
java.io.IOException
- thrown if an IOException occurs while attempting to read the serial port.public void putChar(int b) throws java.io.IOException
b
- a character value between 0 - 255.
java.io.IOException
- thrown if an IOException occurs while attempting to read the serial port.public static java.lang.String getPlatformName()
public static java.lang.String getVersion()
public byte getPort()
public int getSpeed()
public int getDataBits()
public int getParity()
public int getStopBits()
public void releasePort() throws SerialReleaseException
SerialReleaseException
- thrown if the port cannot be released.public boolean portStatus()
public boolean checkPort(byte port)
public void setRTSCTS(boolean state) throws SerialHandshakingException
state
- if true, enables RTS/CTS hardware handshaking.
SerialHandshakingException
- thrown if the serial driver is unable to change modes.public void setDSRDTR(boolean state) throws SerialHandshakingException
state
- if true, enables hardware handshaking.
SerialHandshakingException
- thrown if the serial driver is unable to change modes.public void setXONXOFF(boolean state) throws SerialHandshakingException
state
- if true, enables software handshaking.
SerialHandshakingException
- thrown if the serial driver is unable to change modes.public void startBreak()
public void stopBreak()
public boolean getRTSCTSState()
public boolean getDSRDTRState()
public boolean getXONXOFFState()
|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |