public class SerialFiscalPortSource extends java.lang.Object implements FiscalPortSource, java.lang.Cloneable
Most of the parameters of this class are defined in the javax.comm
package.
Defaults:
portName = null;
appName = "SerialFiscalPort";
openTimeout = 2000; // In milliseconds.
baudRate = 9600;
dataBits = SerialPort.DATABITS_8;
stopBits = SerialPort.STOPBITS_1;
parity = SerialPort.PARITY_NONE;
flowControl = SerialPort.FLOWCONTROL_NONE;
The set of available serial port names can be obtained via SerialFiscalPort.getPortNames()
.
Constructor and Description |
---|
SerialFiscalPortSource() |
SerialFiscalPortSource(java.lang.String portName) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a deep copy of this port source.
|
java.lang.String |
getAppName()
Get the name to report as the requesting application for serial port contention negotiation during open().
|
int |
getBaudRate()
Get the baud rate.
|
int |
getDataBits()
Get the number of data bits.
|
FiscalPort |
getFiscalPort()
Create a SerialFiscalPort object.
|
int |
getFlowControl()
Get the type of flow control if any.
|
int |
getOpenTimeout()
Get the timeout for serial port contention negotiation during open().
|
int |
getParity()
Get the type of parity if any.
|
java.lang.String |
getPortName()
Get the name of the serial port to use.
|
SerialFiscalPort |
getSerialFiscalPort()
Create a SerialFiscalPort object.
|
int |
getStopBits()
Get the number of stop bits.
|
void |
setAppName(java.lang.String appName)
Set the name to report as the requesting application for serial port contention negotiation during open().
|
void |
setBaudRate(int baudRate)
Set the baud rate.
|
void |
setDataBits(int dataBits)
Set the number of data bits.
|
void |
setFlowControl(int flowControl)
Set the type of flow control if any.
|
void |
setOpenTimeout(int openTimeout)
Set the timeout for serial port contention negotiation during open().
|
void |
setParity(int parity)
Set the type of parity if any.
|
void |
setPortName(java.lang.String portName)
Set the name of the serial port to use.
|
void |
setStopBits(int stopBits)
Set the number of stop bits.
|
public SerialFiscalPortSource()
public SerialFiscalPortSource(java.lang.String portName)
public java.lang.Object clone()
FiscalPortSource
clone
in interface FiscalPortSource
clone
in class java.lang.Object
public void setPortName(java.lang.String portName)
public java.lang.String getPortName()
public void setAppName(java.lang.String appName)
public java.lang.String getAppName()
public void setOpenTimeout(int openTimeout)
public int getOpenTimeout()
public void setBaudRate(int baudRate)
public int getBaudRate()
public void setDataBits(int dataBits)
public int getDataBits()
public void setStopBits(int stopBits)
public int getStopBits()
public void setParity(int parity)
public int getParity()
public void setFlowControl(int flowControl)
public int getFlowControl()
public FiscalPort getFiscalPort() throws javax.comm.NoSuchPortException, javax.comm.UnsupportedCommOperationException
getFiscalPort
in interface FiscalPortSource
javax.comm.NoSuchPortException
javax.comm.UnsupportedCommOperationException
public SerialFiscalPort getSerialFiscalPort() throws javax.comm.NoSuchPortException, javax.comm.UnsupportedCommOperationException
javax.comm.NoSuchPortException
javax.comm.UnsupportedCommOperationException