public class SerialWrapper extends Port
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
static boolean |
haveShownNoPortsWarning
This will be set to true once the message about no enumerated ports is shown.
|
static java.lang.String |
SERIAL
The string used to identify a port.
|
static java.lang.String |
serialMappingFileName
The name of the mapping file.
|
Constructor and Description |
---|
SerialWrapper()
Create the wrapper without setting the port (used by BlueTooth).
|
SerialWrapper(java.lang.String description)
The port name for a serial port consists of the string "SERIAL" followed by the port number,
for example "SERIAL0", "SERIAL1", etc.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This will close a port (including all streams).
|
void |
configPorts()
This method will set all the current parameters (baud rate, data bits,
stop bits and parity) to the port.
|
boolean |
connect()
This method will open the port and configure the streams.
|
int |
getBaudRate()
This is the baud rate.
|
int |
getDataBits()
This is the data bits.
|
int |
getFlowControl()
The flow control for both input and output.
|
int |
getParity()
This is the parity.
|
int |
getPort()
This is the port number.
|
int |
getStopBits()
This is the stop bits.
|
static void |
loadMappingFile() |
void |
setBaudRate(int newValue)
This is the baud rate.
|
void |
setDataBits(int newValue)
This is the data bits.
|
void |
setFlowControl(int flowControl)
The flow control for both input and output.
|
void |
setParity(int newValue)
This is the parity.
|
void |
setPortPool(PortPoolInterface portPool)
Opens and closes the port based on the value passed.
|
void |
setStopBits(int newValue)
This is the stop bits.
|
java.lang.String |
toString() |
available, getInputStream, getName, getOutputStream, getPortPool, hasError, read, read, read, readAndWait, readCurrent, setError, setInputStream, setOutputStream, setThread, write, write, write
public static final java.lang.String cvsRev
public static boolean haveShownNoPortsWarning
public static java.lang.String SERIAL
public static java.lang.String serialMappingFileName
public SerialWrapper()
public SerialWrapper(java.lang.String description) throws BadParameterException, java.io.IOException
portName
- BadParameterException
java.io.IOException
public void close()
public void configPorts()
public boolean connect()
public int getBaudRate()
setbaudRate
public int getDataBits()
setDataBits
public int getFlowControl()
public int getParity()
setParity
public int getPort()
public int getStopBits()
setStopBits
public static void loadMappingFile() throws BadParameterException
BadParameterException
public void setBaudRate(int newValue)
getbaudRate
public void setDataBits(int newValue)
getDataBits
public void setFlowControl(int flowControl)
public void setParity(int newValue)
getParity
public void setPortPool(PortPoolInterface portPool)
setPortPool
in interface PortInterface
setPortPool
in class Port
Port.setPortPool(com.ergotech.vib.ports.PortPoolInterface)
public void setStopBits(int newValue)
getStopBits
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1999-2021 ErgoTech Systems, Inc. All Rights Reserved.