|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.starmicronics.stario.StarIOPort
This class provides a communications API for Star Micronics's printers. It supports serial, parallel, usb, and ethernet based printers, and hides most of the low level behavioral differences inherent in those different communication forms.
Method Summary | |
StarPrinterStatus |
beginCheckedBlock()
This method initiates a checked block printing operation and returns the device's detailed status. |
StarPrinterStatus |
endCheckedBlock()
This method ends a checked block printing operation and returns the device's detailed status. |
protected void |
finalize()
|
static StarIOPort |
getPort(java.lang.String portName,
java.lang.String portSettings,
int ioTimeoutMillis)
This method opens a connection to the specified port. |
java.lang.String |
getPortName()
This method returns the port name as it was originally specified. |
java.lang.String |
getPortSettings()
This method returns the port settings as they were originally specified. |
int |
readPort(byte[] readBuffer,
int offset,
int size)
This method reads data from the device. |
static void |
releasePort(StarIOPort port)
This function closes a connection to the port specified. |
void |
resetDevice()
This method resets the device at the hardware level. |
StarPrinterStatus |
retreiveStatus()
This method retreives the device's detailed status. |
int |
writePort(byte[] writeBuffer,
int offset,
int size)
This method writes data to the device. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static StarIOPort getPort(java.lang.String portName, java.lang.String portSettings, int ioTimeoutMillis) throws StarIOPortException
portName
- is the name of the port to openportSettings
- gives the port settings - "9600,n,8,1,h" for serial, "" for all othersioTimeoutMillis
- millisecond timeout controlling internally used communication APIs (this parameter garantees that all of the below APIs will complete in a bounded amount of time, but does NOT garantee the exact timeout length)
StarIOPortException
- when a communication failure occurs.public static void releasePort(StarIOPort port)
port
- StarIOPorttype representing previously created portpublic java.lang.String getPortName()
public java.lang.String getPortSettings()
public int writePort(byte[] writeBuffer, int offset, int size) throws StarIOPortException
writeBuffer
- contains the output dataoffset
- specifies where to begin pulling data from writeBuffer - zero-based offsetsize
- number of bytes to write
StarIOPortException
- when a communication failure occurspublic int readPort(byte[] readBuffer, int offset, int size) throws StarIOPortException
offset
- specifies where to begin writing data into the readBuffer - zero-based offsetsize
- number of bytes to read
StarIOPortException
- when a communication failure occurspublic StarPrinterStatus retreiveStatus() throws StarIOPortException
StarIOPortException
- when a communication failure occurspublic StarPrinterStatus beginCheckedBlock() throws StarIOPortException
StarIOPortException
- when a communication failure occurspublic StarPrinterStatus endCheckedBlock() throws StarIOPortException
StarIOPortException
- when a communication failure occurspublic void resetDevice() throws StarIOPortException
StarIOPortException
- when a communication failure occursprotected void finalize() throws java.lang.Throwable
java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |