SmartPos SDK for Android 1.4.1

Data Structures | Public Member Functions
com.paydevice.smartpos.sdk.printer.SerialPortPrinter Class Reference

Class of SerialPortPrinter implement. More...

Inheritance diagram for com.paydevice.smartpos.sdk.printer.SerialPortPrinter:

## Public Member Functions
void | selectPrinter (String path, int speed)
| Select external serialport printer. More...
void | selectBuiltInPrinter ()
| Select built-in printer. More...
void | open () throws SmartPosException
| Open printer(power on take about 100ms) More...
void | close () throws SmartPosException
| Close printer. More...
int | read (byte[] buf, int len) throws SmartPosException
| Read data from printer. More...
void | write (byte[] buf, int len) throws SmartPosException
| Write data to printer. More...
int | getType ()
| Get the printer type. More...
String[] | getPrinterList ()
| Get all serialport path. More...

## Detailed Description

Class of SerialPortPrinter implement.

## Member Function Documentation

## ◆ close()

void com.paydevice.smartpos.sdk.printer.SerialPortPrinter.close | ( |  | ) | throws SmartPosException

Close printer.

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

## ◆ getPrinterList()

String [] com.paydevice.smartpos.sdk.printer.SerialPortPrinter.getPrinterList | ( |  | ) |

Get all serialport path.

Returns
  path string array of all serialport

## ◆ getType()

int com.paydevice.smartpos.sdk.printer.SerialPortPrinter.getType | ( |  | ) |

Get the printer type.

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

## ◆ open()

void com.paydevice.smartpos.sdk.printer.SerialPortPrinter.open | ( |  | ) | throws SmartPosException

Open printer(power on take about 100ms)

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

## ◆ read()

int com.paydevice.smartpos.sdk.printer.SerialPortPrinter.read | ( | byte[] | buf,
|  | int | len
| ) |  | throws SmartPosException

Read data from printer.

Parameters

  buf | data buffer
  len | data len

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

## ◆ selectBuiltInPrinter()

void com.paydevice.smartpos.sdk.printer.SerialPortPrinter.selectBuiltInPrinter | ( |  | ) |

Select built-in printer.

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

## ◆ selectPrinter()

void com.paydevice.smartpos.sdk.printer.SerialPortPrinter.selectPrinter | ( | String | path,
|  | int | speed
| ) |  |

Select external serialport printer.

Parameters

  path | of the serialport, e.g: /dev/ttyUSB0
  speed | at which to open the serialport, e.g: 115200

Returns

## ◆ write()

void com.paydevice.smartpos.sdk.printer.SerialPortPrinter.write | ( | byte[] | buf,
|  | int | len
| ) |  | throws SmartPosException

Write data to printer.

Parameters

  buf | data buffer
  len | data len

Returns

Implements com.paydevice.smartpos.sdk.printer.Printer.

The documentation for this class was generated from the following file:

- src/com/paydevice/smartpos/sdk/printer/SerialPortPrinter.java