public class LedAPI
extends java.lang.Object
| Constructor and Description |
|---|
LedAPI(android.content.Context mContext)
LED Display API
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearbuffer()
清空接收缓存区 Empty receive buffer
|
int |
connect(java.lang.String serialPort,
int baudRate,
int flowControl)
创建连接 Create connection
|
int |
disconnect()
断开连接 disconnect
|
boolean |
isConnect()
是否连接 Is it connected
|
boolean |
LED_ClearLine()
清除光标行 Clear cursor line
|
boolean |
LED_ClearScreen()
清屏 Clear display screen
|
boolean |
LED_Display(java.lang.String data,
java.lang.String charset)
发送文本到客显 Write string to display
|
boolean |
LED_Init()
初始化 Initialize display
|
boolean |
LED_MoveCursor(int n)
光标移动到指定位置 Move cursor to specified position
|
boolean |
LED_SetBaudRate(int n)
设置波特率 Set BaudRate to display
|
boolean |
LED_SetCursorFlag(int n)
设置光标状态 Set cursor flag
|
boolean |
LED_SetStatusLight(int n)
设置状态小灯显示 Set status light
|
int |
setBaudrate(int _baudRate)
设置波特率 setup baud rate
|
public static final int SUCCESS
public static final int FAIL
public LedAPI(android.content.Context mContext)
mContext - public int connect(java.lang.String serialPort,
int baudRate,
int flowControl)
serialPort - 端口号baudRate - 波特率flowControl - 流控 0:no 1:yespublic int setBaudrate(int _baudRate)
_baudRate - 波特率public int disconnect()
public boolean isConnect()
public void clearbuffer()
public boolean LED_SetCursorFlag(int n)
n - 0<=n<=1
n=0 光标暗
n=1 光标亮public boolean LED_MoveCursor(int n)
n - 1<=n<=8public boolean LED_SetStatusLight(int n)
n - 0<=n<=4
n=0 全暗 None
n=1 单价 Price
n=2 总计 Total
n=3 收款 Collect
n=4 找零 Changepublic boolean LED_ClearScreen()
public boolean LED_ClearLine()
public boolean LED_Init()
public boolean LED_Display(java.lang.String data,
java.lang.String charset)
data - 文本内容(数字和小数点)public boolean LED_SetBaudRate(int n)
n - 0 ≦ n ≦ 2
n = 0, 9600
n = 1, 4800
n = 2, 2400