POSAPI
类 POSSerialAPI
java.lang.Object
POSAPI.POSInterfaceAPI
POSAPI.POSSerialAPI
public class POSSerialAPI
- extends POSInterfaceAPI
方法摘要 |
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
函数功能:发送数据
参数描述: |
从类 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