POSAPI
类 POSSerialAPI

java.lang.Object
  继承者 POSAPI.POSInterfaceAPI
      继承者 POSAPI.POSSerialAPI

public class POSSerialAPI
extends POSInterfaceAPI


字段摘要
static int ERR_PROCESSING
           
 SerialPort mSerialport
           
static int POS_FAIL
           
static int POS_SUCCESS
           
static int READBYTEMAX
           
static int WRITEBYTEMAX
           
 
从类 POSAPI.POSInterfaceAPI 继承的字段
ERR_PARAM
 
构造方法摘要
POSSerialAPI()
           
 
方法摘要
 int CloseDevice()
          函数名称:CloseDevice 函数功能:关闭端口 参数描述: 返回值说明:
 int OpenDevice(java.io.File device, int baudrate)
          函数名称:OpenDevice 函数功能:创建串口对象,并打开 参数描述:
 int ReadBuffer(byte[] ReadBuffer, int OffsetSize, int nBytesToRead, int ReadTimeOut)
          函数名称:ReadBuffer 函数功能:从串口设备中读取数据 参数描述:。
 int WriteBuffer(byte[] WriteBuffer, int OffsetSize, int nBytesToWrite, int WriteTimeOut)
          函数名称:WriteBuffer 函数功能:发送数据 参数描述:
 
从类 POSAPI.POSInterfaceAPI 继承的方法
OpenDevice, OpenDevice, OpenDevice, ReadBuffer, WIFIsearchPort
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

mSerialport

public SerialPort mSerialport

POS_SUCCESS

public static final int POS_SUCCESS
另请参见:
常量字段值

ERR_PROCESSING

public static final int ERR_PROCESSING
另请参见:
常量字段值

POS_FAIL

public static final int POS_FAIL
另请参见:
常量字段值

WRITEBYTEMAX

public static final int WRITEBYTEMAX
另请参见:
常量字段值

READBYTEMAX

public static final int READBYTEMAX
另请参见:
常量字段值
构造方法详细信息

POSSerialAPI

public POSSerialAPI()
方法详细信息

OpenDevice

public int OpenDevice(java.io.File device,
                      int baudrate)
函数名称:OpenDevice 函数功能:创建串口对象,并打开 参数描述:

覆盖:
POSInterfaceAPI 中的 OpenDevice
参数:
device[in]:串口号 -
baudrate[in]:设备波特率 -
flags[in]: - 标示 返回值说明:
返回:
成功:POS_SUCCESS,失败:ERR_PROCESSING

WriteBuffer

public int WriteBuffer(byte[] WriteBuffer,
                       int OffsetSize,
                       int nBytesToWrite,
                       int WriteTimeOut)
函数名称:WriteBuffer 函数功能:发送数据 参数描述:

覆盖:
POSInterfaceAPI 中的 WriteBuffer
参数:
WriteBuffer[in]: - 发送端口数据的缓冲区
OffsetSize[in]: - 发送数据的地址的偏移量
nBytesToWrite[in]:发送端口数据的字节数 -
WriteTimeOut[in]:发送端口数据超时设置 - 返回值说明:
返回:
成功:返回实际写入的字节数,失败:返回0

ReadBuffer

public int ReadBuffer(byte[] ReadBuffer,
                      int OffsetSize,
                      int nBytesToRead,
                      int ReadTimeOut)
函数名称:ReadBuffer 函数功能:从串口设备中读取数据 参数描述:。

覆盖:
POSInterfaceAPI 中的 ReadBuffer
参数:
ReadBuffer[in]: - 存放读取数据的缓冲区
OffsetSize[in]: - 读取数据的地址的偏移量
nBytesToWrite[in]:读取数据的字节数 -
ReadTimeOut[in]: - 读取数据超时设置 返回值说明:
返回:
成功:返回实际写入的字节数,失败:返回0

CloseDevice

public int CloseDevice()
函数名称:CloseDevice 函数功能:关闭端口 参数描述: 返回值说明:

覆盖:
POSInterfaceAPI 中的 CloseDevice
返回:
成功:POS_SUCCESS,失败:ERR_PROCESSING