ADRcp

com.ad.rfid

## 类 ADRcp

- java.lang.Object
- - com.ad.rfid.ADRcp

- 直接已知子类:
    PassiveRcp, PhychipsRcp

      public abstract class ADRcp
      extends Object

  Communication Data Managed Base Class(通讯数据处理基类)
  作者:
    endyc

- - ### 构造器概要

    构造器
    构造器和说明
    `ADRcp()`
    `ADRcp(ADSio sio)`

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addOnProtocolListener(OnProtocolListener event)` add new Asynchronous Communication event
    `abstract byte[]` | `buildCmdPacketByte(byte nType, byte nCmd, byte[] ArgByte)` packet command data (打包命令数据)
    `byte[]` | `buildCmdPacketByte(byte nHead, int nAddr, byte nType, byte nCmd, byte[] ArgByte)` packet command data (打包命令数据)
    `abstract byte[]` | `buildCmdPacketByte(int nAddr, byte nType, byte nCmd, byte[] ArgByte)` packet command data (打包命令数据)
    `boolean` | `connect(String host, int port, int type)` Create a communication connection
    `void` | `disConnect()` DisConnect communication connection
    `int` | `getAddress()` get Communication address(通讯地址)
    `int` | `getDelay()` get Receive data delaytime(数据接收超时标志)
    `int` | `getDeviceMode()` device mode 设备类型
    `String` | `getMode()` Communication device mode(通讯设备类型)
    `boolean` | `getRcpReceivedPacket()` get receive data mark
    `String` | `getType()` get Communication device type(通讯设备型号)
    `String` | `getVersion()` device version(设备版本号)
    `boolean` | `isConnected()` check the communication is connected
    `void` | `removeOnProtocolListener(OnProtocolListener event)` remove old Asynchronous Communication event
    `boolean` | `sendBytePkt(byte[] pkt)` send packet data (发送数据包)
    `boolean` | `sendBytePkt(byte[] pkt, int delay)` send packet data (发送数据包)
    `void` | `setAddress(int value)` set Communication address(通讯地址)
    `void` | `setDelay(int value)` set Receive data delaytime(数据接收超时标志)
    `void` | `setMode(String value)` Communication device mode(通讯设备类型)
    `void` | `setOnProtocolListener(OnProtocolListener event)` set current Asynchronous Communication event
    `void` | `setSio(ADSio sio)` set current communication class
    `void` | `setType(String value)` set Communication device type(通讯设备型号)
    `void` | `setVersion(String value)` device version(设备版本号)

    - ### 从类继承的方法 java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### ADRcp

          public ADRcp()

    - #### ADRcp

          public ADRcp(ADSio sio)

  - ### 方法详细资料

    - #### setOnProtocolListener

          public void setOnProtocolListener(OnProtocolListener event)

      set current Asynchronous Communication event
      参数:
        `event` -

    - #### addOnProtocolListener

          public void addOnProtocolListener(OnProtocolListener event)

      add new Asynchronous Communication event
      参数:
        `event` -

    - #### removeOnProtocolListener

          public void removeOnProtocolListener(OnProtocolListener event)

      remove old Asynchronous Communication event
      参数:
        `event` -

    - #### getRcpReceivedPacket

          public boolean getRcpReceivedPacket()

      get receive data mark
      返回:

    - #### getDelay

          public int getDelay()

      get Receive data delaytime(数据接收超时标志)

    - #### setDelay

          public void setDelay(int value)

      set Receive data delaytime(数据接收超时标志)

    - #### getAddress

          public int getAddress()

      get Communication address(通讯地址)

    - #### setAddress

          public void setAddress(int value)

      set Communication address(通讯地址)

    - #### getMode

          public String getMode()

      Communication device mode(通讯设备类型)

    - #### setMode

          public void setMode(String value)

      Communication device mode(通讯设备类型)

    - #### getType

          public String getType()

      get Communication device type(通讯设备型号)

    - #### setType

          public void setType(String value)

      set Communication device type(通讯设备型号)

    - #### getVersion

          public String getVersion()

      device version(设备版本号)

    - #### setVersion

          public void setVersion(String value)

      device version(设备版本号)

    - #### getDeviceMode

          public int getDeviceMode()

      device mode 设备类型

    - #### setSio

          public void setSio(ADSio sio)

      set current communication class
      参数:
        `sio` -

    - #### isConnected

          public boolean isConnected()

      check the communication is connected
      返回:

    - #### connect

          public boolean connect(String host,
                                 int port,
                                 int type)

      Create a communication connection
      参数:
        `host` - IP Address or Comport
        `port` - IP Port or Baudrate
        `type` - Communication Type 0 - SERIAL,1 - NET,2 - USB
      返回:

    - #### disConnect

          public void disConnect()

      DisConnect communication connection

    - #### buildCmdPacketByte

          public abstract byte[] buildCmdPacketByte(byte nType,
                                                    byte nCmd,
                                                    byte[] ArgByte)

      packet command data (打包命令数据)
      参数:
        `nType` - 命令方式,get of set
        `nCmd` - 命令类型
        `ArgByte` - 数据
      返回:

    - #### buildCmdPacketByte

          public abstract byte[] buildCmdPacketByte(int nAddr,
                                                    byte nType,
                                                    byte nCmd,
                                                    byte[] ArgByte)

      packet command data (打包命令数据)
      参数:
        `nAddr` - 通讯地址
        `nType` - 命令方式,get of set
        `nCmd` - 命令类型
        `ArgByte` - 数据
      返回:

    - #### buildCmdPacketByte

          public byte[] buildCmdPacketByte(byte nHead,
                                           int nAddr,
                                           byte nType,
                                           byte nCmd,
                                           byte[] ArgByte)

      packet command data (打包命令数据)
      参数:
        `nHead` - 命令头
        `nAddr` - 通讯地址
        `nType` - 命令方式,get of set
        `nCmd` - 命令类型
        `ArgByte` - 数据
      返回:

    - #### sendBytePkt

          public boolean sendBytePkt(byte[] pkt)

      send packet data (发送数据包)
      参数:
        `pkt` - packet data(数据包)
      返回:

    - #### sendBytePkt

          public boolean sendBytePkt(byte[] pkt,
                                     int delay)

      send packet data (发送数据包)
      参数:
        `pkt` - packet data(数据包)
        `delay` - send to recive delay (发送转接收超时间隔ms)
      返回: