public class DspAPI
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
DspAPI.UploadListener
Upload event listener
|
| Constructor and Description |
|---|
DspAPI(android.content.Context mContext)
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 |
DSP_ChangeBaudRate(int baudrate)
临时修改波特率(不保存) Set baud rate temporarily (not save)
|
boolean |
DSP_ChangeCharset(int n)
选择国际编码(不保存) Select international character set (not save)
|
boolean |
DSP_ChangeCodepage(int n)
选择扩展编码(不保存)Select character code table (not save)
|
boolean |
DSP_ClearLine()
清除光标行 Clear cursor line
|
boolean |
DSP_ClearScreen()
清屏 Clear display screen
|
boolean |
DSP_Dispay_At(java.lang.String text,
java.lang.String charset,
int row,
int column)
发送文本到客显指定位置 Send the text to the specified position of the display
|
boolean |
DSP_Dispay_UpperLineScroll(java.lang.String text,
java.lang.String charset)
首行消息连续滚动 Upper line message scroll continuously
|
boolean |
DSP_Dispay(java.lang.String text,
java.lang.String charset)
发送文本到客显 Send text to display
|
boolean |
DSP_DisplayQrCode(java.lang.String text,
int x,
int y)
显示二维码 Display QrCode
|
boolean |
DSP_DisplayQrCodeOnPicture(java.lang.String data,
int x,
int n)
在图片上显示二维码 Display QrCode on picture
|
int |
DSP_GetFirmwareVersion_VFD()
获取设备固件版本(VFD/LCM) Get Firmware Version(VFD/LCM)
|
int |
DSP_GetFirmwareVersion()
获取设备固件版本(LCD) Get Firmware Version(LCD)
|
java.lang.String |
DSP_GetModel()
获取设备型号 Get device model
|
boolean |
DSP_Init()
初始化 Initialize display
|
boolean |
DSP_MoveCursor(int row,
int column)
光标移动到指定位置 Move cursor to specified position
|
boolean |
DSP_MoveCursorDown()
光标下移 Move cursor down
|
boolean |
DSP_MoveCursorEnd()
光标移动到终点 Move cursor to bottom position
|
boolean |
DSP_MoveCursorEndLeft()
光标移动到最左端 Move cursor to left-most position
|
boolean |
DSP_MoveCursorEndRight()
光标移动到最右端 Move cursor to right-most position
|
boolean |
DSP_MoveCursorHome()
光标返回起点 Move cursor to home position
|
boolean |
DSP_MoveCursorLeft()
光标左移 Move cursor left
|
boolean |
DSP_MoveCursorRight()
光标右移 Move cursor right
|
boolean |
DSP_MoveCursorUp()
光标上移 Move cursor up
|
boolean |
DSP_Restart()
重启客显 Restart display
|
boolean |
DSP_SelfTest()
自检 Execute self-test
|
boolean |
DSP_SetBackGroundColor_Central(int color)
设置中部背景颜色 Set middle BackGround color
|
boolean |
DSP_SetBackGroundColor_Footer(int color)
设置底部背景颜色(第二行欢迎语) Set Footer BackGround color (second welcome line)
|
boolean |
DSP_SetBackGroundColor_Header(int color)
设置标题行背景颜色(第一行欢迎语)Set Header BackGround color (first line of welcome)
|
boolean |
DSP_SetBaudRate(int n)
设置波特率(保存) Set BaudRate to display (save)
|
boolean |
DSP_SetBlink(int n)
设置闪烁频率 Blink display screen
|
boolean |
DSP_SetBodyDefaultText(java.lang.String text1,
java.lang.String text2,
java.lang.String text3,
java.lang.String text4,
java.lang.String charset)
设置正文默认文本 Set Body default text
|
boolean |
DSP_SetBrightness(int n)
调节背光亮度 Brightness adjustment
|
boolean |
DSP_SetCharset(int n)
设置国际编码(保存) Setup international character set (save)
|
boolean |
DSP_SetCodepage(int n)
设置扩展编码(保存) Setup character code table (save)
|
boolean |
DSP_SetCommandSet(int n)
设置命令集 Set command set
|
boolean |
DSP_SetLines(int n)
设置文本显示行数 Set the number of text display lines
|
boolean |
DSP_SetPlayed(int value)
设置播放的图片 Set the pictures to play
|
boolean |
DSP_SetPlayInterval(int time)
设置图片播放间隔时间 Set the display interval of pictures
|
boolean |
DSP_SetStandbyTime(int time)
设置图片播放待机时间 Set pictures display standby time
|
boolean |
DSP_SetTextColor_Central(int color)
设置中部文本颜色 Set middle text color
|
boolean |
DSP_SetTextColor_Footer(int color)
设置底部文本颜色(第二行欢迎语) Set Footer text color (second welcome line)
|
boolean |
DSP_SetTextColor_Header(int color)
设置标题行文本颜色(第一行欢迎语)Set Header text color (first line of welcome)
|
boolean |
DSP_SetWelMessage_1(java.lang.String text,
java.lang.String charset)
设置第一行欢迎语 Set the first line of welcome
|
boolean |
DSP_SetWelMessage_2_Scroll(boolean b)
设置第二行欢迎语滚动标志 Set the second line of welcome scrolling sign
|
boolean |
DSP_SetWelMessage_2(java.lang.String text,
java.lang.String charset)
设置第二行欢迎语 Set the second line of welcome
|
boolean |
DSP_ShowPicture(int n)
展示一张图片 Show a picture
|
int |
DSP_UploadPicture(java.lang.String fileName,
java.lang.String filePath,
int width,
int height)
上传图片到客显 Upload pictures to display
|
boolean |
isConnect()
是否连接 Is it connected
|
int |
setBaudrate(int _baudRate)
设置波特率 setup baud rate
|
void |
setUploadListener(DspAPI.UploadListener mUploadListener)
Set Upload event listener
|
public static final int SUCCESS
public static final int FAIL
public DspAPI(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 DSP_Dispay(java.lang.String text,
java.lang.String charset)
text - 文本内容charset - 字符编码public boolean DSP_Dispay_At(java.lang.String text,
java.lang.String charset,
int row,
int column)
text - 文本内容charset - 字符编码row - 行column - 列public boolean DSP_Dispay_UpperLineScroll(java.lang.String text,
java.lang.String charset)
text - 文本内容charset - 字符编码public boolean DSP_MoveCursorLeft()
public boolean DSP_MoveCursorRight()
public boolean DSP_MoveCursorUp()
public boolean DSP_MoveCursorDown()
public boolean DSP_MoveCursorHome()
public boolean DSP_MoveCursorEndLeft()
public boolean DSP_MoveCursorEndRight()
public boolean DSP_MoveCursorEnd()
public boolean DSP_MoveCursor(int row,
int column)
row - 行 1 ≦ row ≦ 2(4)column - 列 1 ≦ column ≦ 20public boolean DSP_Init()
public boolean DSP_ClearScreen()
public boolean DSP_ClearLine()
public boolean DSP_SetWelMessage_1(java.lang.String text,
java.lang.String charset)
text - 文本内容charset - 字符编码public boolean DSP_SetWelMessage_2(java.lang.String text,
java.lang.String charset)
text - 文本内容charset - 字符编码public boolean DSP_SetWelMessage_2_Scroll(boolean b)
b - false:No scrolling true:Scrollingpublic boolean DSP_SetBodyDefaultText(java.lang.String text1,
java.lang.String text2,
java.lang.String text3,
java.lang.String text4,
java.lang.String charset)
text1 - line1 texttext2 - line2 texttext3 - line3 texttext4 - line4 textcharset - 字符编码public boolean DSP_SetTextColor_Header(int color)
color - public boolean DSP_SetTextColor_Central(int color)
color - public boolean DSP_SetTextColor_Footer(int color)
color - public boolean DSP_SetBackGroundColor_Header(int color)
color - public boolean DSP_SetBackGroundColor_Central(int color)
color - public boolean DSP_SetBackGroundColor_Footer(int color)
color - public boolean DSP_SetCommandSet(int n)
n - 0 ~ 13
30h, LD220
31h, EPSON Esc/POS
32h, AEDEX
33h, UTC/S
34h, UTC/E
35h, ADM788
36h, DSP800
37h, CD5220
38h, EMAX
39h, LOGIC CONTROL
3Ah, ICD2002
3Bh, EZ-202
3Ch, PL-200
3Dh, PD3000public boolean DSP_SetCharset(int n)
n - 国际编码编号public boolean DSP_ChangeCharset(int n)
n - 国际编码编号public boolean DSP_SetCodepage(int n)
n - 扩展编码编号public boolean DSP_ChangeCodepage(int n)
n - 扩展编码编号public boolean DSP_SetBlink(int n)
n - 0 ≦ n ≦ 255(n*50msec)ON / (n*50msec)OFF
n= 0, blinking is canceled
n=255, display is turned offpublic boolean DSP_SetLines(int n)
n - 1: line 2 2:line 4public boolean DSP_Restart()
public boolean DSP_SelfTest()
public boolean DSP_SetBrightness(int n)
n - 1 ≦ n ≦ 4public boolean DSP_SetBaudRate(int n)
n - 0 ≦ n ≦ 4
n = 0, 9600
n = 1, 19200
n = 2, 38400
n = 3, 57600
n = 4, 115200public boolean DSP_ChangeBaudRate(int baudrate)
baudrate - 9600, 19200.......public boolean DSP_DisplayQrCode(java.lang.String text,
int x,
int y)
text - 二维码内容x - 横向位置
x=1 left
x=2 center
x=3 righty - 纵向位置
y=1 top
y=2 center
y=3 bottompublic boolean DSP_DisplayQrCodeOnPicture(java.lang.String data,
int x,
int n)
data - 二维码内容x - 横向位置
x=1 left
x=2 center
x=3 rightn - 图片序号 Picture number
1 <= n <= 10public java.lang.String DSP_GetModel()
public int DSP_GetFirmwareVersion()
public int DSP_GetFirmwareVersion_VFD()
public boolean DSP_SetPlayed(int value)
value - bit0~9 = picture 1~10 1=Y 0=Npublic boolean DSP_ShowPicture(int n)
n - 图片序号 Picture numberpublic boolean DSP_SetPlayInterval(int time)
time - 间隔时间(秒) Interval time(second)public boolean DSP_SetStandbyTime(int time)
time - 待机时间(秒) Standby time(second)public int DSP_UploadPicture(java.lang.String fileName,
java.lang.String filePath,
int width,
int height)
fileName - 文件名(固定)File name (fixed)filePath - 文件路径 File pathpublic void setUploadListener(DspAPI.UploadListener mUploadListener)
mUploadListener -