public class SerialFiscalPort extends java.lang.Object implements FiscalPort
javax.comm
API to communicate over serial ports.Constructor and Description |
---|
SerialFiscalPort(java.lang.String portName,
java.lang.String appName,
int openTimeout,
int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the port.
|
void |
flushAndWait()
Flush the output stream and wait until output is done.
|
int |
getBaudRate()
Get the baud rate.
|
java.io.InputStream |
getInputStream()
Get the input stream.
|
java.io.OutputStream |
getOutputStream()
Get the output stream.
|
java.lang.String |
getPortName()
Get the underlying serial port name.
|
static java.util.SortedSet |
getPortNames()
Get an alphabetically sorted set of available serial port names.
|
javax.comm.SerialPort |
getSerialPort()
Get the underlying serial port or null if the port is not open.
|
int |
getTimeout()
Get the receive timeout.
|
boolean |
isOpen()
Returns true if the port is open.
|
void |
open()
Open the port.
|
void |
setBaudRate(int baudRate)
Set the baud rate.
|
void |
setTimeout(int ms)
Set the receive timeout.
|
public SerialFiscalPort(java.lang.String portName, java.lang.String appName, int openTimeout, int baudRate, int dataBits, int stopBits, int parity, int flowControl) throws javax.comm.NoSuchPortException, javax.comm.UnsupportedCommOperationException
javax.comm.NoSuchPortException
javax.comm.UnsupportedCommOperationException
public static java.util.SortedSet getPortNames()
public void open() throws javax.comm.PortInUseException, javax.comm.UnsupportedCommOperationException, java.io.IOException
FiscalPort
open
in interface FiscalPort
javax.comm.PortInUseException
javax.comm.UnsupportedCommOperationException
java.io.IOException
public void close() throws java.io.IOException
FiscalPort
close
in interface FiscalPort
java.io.IOException
public boolean isOpen()
FiscalPort
isOpen
in interface FiscalPort
public java.lang.String getPortName()
public javax.comm.SerialPort getSerialPort()
public void setBaudRate(int baudRate) throws javax.comm.UnsupportedCommOperationException
FiscalPort
setBaudRate
in interface FiscalPort
javax.comm.UnsupportedCommOperationException
public int getBaudRate()
FiscalPort
getBaudRate
in interface FiscalPort
public void setTimeout(int ms) throws javax.comm.UnsupportedCommOperationException
FiscalPort
setTimeout
in interface FiscalPort
javax.comm.UnsupportedCommOperationException
public int getTimeout()
FiscalPort
getTimeout
in interface FiscalPort
public java.io.InputStream getInputStream() throws java.io.IOException
FiscalPort
getInputStream
in interface FiscalPort
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
FiscalPort
getOutputStream
in interface FiscalPort
java.io.IOException
public void flushAndWait() throws java.io.IOException
FiscalPort
flushAndWait
in interface FiscalPort
java.io.IOException