MainHandler

Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.jlrfid.service
Class MainHandler

    java.lang.Object
      com.jlrfid.service.MainHandler

    public class MainHandler

extends java.lang.Object

Dll core operation

Author:
  niuzehao

Constructor Summary
`MainHandler()`

Method Summary
`boolean` | `BeginInv(GetReadData getReadData)` reading circulation when start to circulation reading, do other operation should stop inventory first, such write tag or read antenna send circulation reading order by start sub thread, after sending order, the method will callback function getReadData
`void` | `close()`
`void` | `deviceDisconnect()` disconnection
`boolean` | `deviceInit(java.lang.String ip, int comm, int port)` connect reader, when parameter comm is not 0, can connect by serial port, when parameter comm is 0, can connect by TCP/IP
`void` | `deviceUnInit()` restore initialization
`boolean` | `dllInit(java.lang.String dllName)` load Dll file
`AntStruct` | `GetAnt()` get the related configuration of antenna
`java.lang.String` | `GetDevVersion()` getting device version No.
`java.lang.String` | `GetDI()` get Digital Input status
`UHFOperate` | `getUhfOperate()`
`boolean` | `InvOnce(GetReadData getReadData)` inventory once send circulation reading order by start sub thread, after sending success, the method will callback getReadData.
`boolean` | `KillTag(java.lang.String pKill_pwd, java.lang.String access_pwd)` kill tag
`boolean` | `lockTag(int opcode, int block, java.lang.String password)` lock tag
`java.lang.String` | `ReadTagData(int bank, int begin, int size, java.lang.String password)` get the single card data, can set the reading area, start address and reading length
`boolean` | `SetAlive(byte intervalSecond)` set alive time interval
`boolean` | `SetAnt(byte[] antEnable, long[] dwellTime, long[] power)`
`boolean` | `SetDO(byte port, byte state)` set Digital Output status
`void` | `setUhfOperate(UHFOperate uhfOperate)`
`boolean` | `StopInv()` stop circular inventory
`boolean` | `WriteTagData(char bank, char begin, char size, java.lang.String data, java.lang.String password)` write single card data, can set the writing area, start add and reading length

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MainHandler

    public MainHandler()

Method Detail

### setUhfOperate

    public void setUhfOperate(UHFOperate uhfOperate)

### getUhfOperate

    public UHFOperate getUhfOperate()

### dllInit

    public boolean dllInit(java.lang.String dllName)

  load Dll file

  Parameters:
    `dllName:` - dll file name, dllName can be the file name when below the project root directory, if not, dllName should add the file path
  Returns:
    mark of load succeed or not: succeed:true, failed:false
  Throws:
    `java.net.URISyntaxException`

### deviceInit

    public boolean deviceInit(java.lang.String ip,
                              int comm,
                              int port)

  connect reader, when parameter comm is not 0, can connect by serial port, when parameter comm is 0, can connect by TCP/IP

  Parameters:
    `ip:` - reader IP address
    `comm:` - serial port
    `port:` - reader network port or serial port baud rate
  Returns:
    mark of connection or not: succeed: true, failed:false

### BeginInv

    public boolean BeginInv(GetReadData getReadData)
                     throws RFIDException

  reading circulation when start to circulation reading, do other operation should stop inventory first, such write tag or read antenna send circulation reading order by start sub thread, after sending order, the method will callback function getReadData

  Parameters:
    `getReadData:` - callback function object of return reading data
  Returns:
    mark of order sending successful: succeed: true, failed:false
  Throws:
    `RFIDException`

### StopInv

    public boolean StopInv()

  stop circular inventory

  Returns:
    mark of order sending successful: succeed: true, failed:false

### deviceDisconnect

    public void deviceDisconnect()

  disconnection

### deviceUnInit

    public void deviceUnInit()

  restore initialization

### GetDevVersion

    public java.lang.String GetDevVersion()

  getting device version No.

  Returns:
    version character string

### GetAnt

    public AntStruct GetAnt()

  get the related configuration of antenna

  Returns:
    antenna data structure

### SetAnt

    public boolean SetAnt(byte[] antEnable,
                          long[] dwellTime,
                          long[] power)
                   throws RFIDException

  Parameters:
    `antEnable` - antenna enable array or not, length only can be 4,value only can be 0£¨antenna enabled£©or 1£¨antenna not enabled£©
    `dwellTime` - antenna time array, 4 antenna has 4 related variable of array, time range 50-10000
    `power` - antenna power array, 4 antenna has 4 related variable of array, power range 20-33, the unit is ms
  Returns:
    mark of setting succeed or not
  Throws:
    `RFIDException`

### ReadTagData

    public java.lang.String ReadTagData(int bank,
                                        int begin,
                                        int size,
                                        java.lang.String password)
                                 throws RFIDException

  get the single card data, can set the reading area, start address and reading length

  Parameters:
    `bank` - reading area. as following: 0¡ª¡ª Reserve 1¡ª¡ªEPC 2¡ª¡ªTID 3¡ª¡ªUser
    `begin` - get the address of area, value range is 0-7.
    `size` - reading length, value range is 1 to 8£¨1Word = 2Bytes = 16 bits£©£¨explanation£ºbank=EPC area, the value of begin+size is not over 8 £®bank=Reserve area£¬the value of begin+size is not over 4£®£©.
    `password` - reader password default can be null
  Returns:
    succeed: return the Hex character string failed: return -1
  Throws:
    `RFIDException`

### WriteTagData

    public boolean WriteTagData(char bank,
                                char begin,
                                char size,
                                java.lang.String data,
                                java.lang.String password)
                         throws RFIDException

  write single card data, can set the writing area, start add and reading length

  Parameters:
    `bank` - writing area. as following: 0¡ª¡ªReserve 1¡ª¡ªEPC 2¡ª¡ªTID 3¡ª¡ªUser
    `begin` - the address of writing area, value range is 0-7.
    `size` - writing length, value range is 1 to 8£¨1 Word = 2 Bytes = 16 bits£©£¨explanation£ºbank=EPC area£¬the value of begin+size is not over 8 £®bank=Reserve area£¬the value of begin+size is not over 4£®£©¡£
    `password` - write the password, default can be null
  Returns:
    mark of writing succeed or not
  Throws:
    `RFIDException`

### InvOnce

    public boolean InvOnce(GetReadData getReadData)
                    throws RFIDException

  inventory once send circulation reading order by start sub thread, after sending success, the method will callback getReadData.

  Parameters:
    `getReadData:` - callback function object of reading return data
  Returns:
    mark of order sending success: succeed true, failed false
  Throws:
    `RFIDException`

### SetAlive

    public boolean SetAlive(byte intervalSecond)
                     throws RFIDException

  set alive time interval

  Parameters:
    `intervalSecond` - time interval will be setted, unit is second
  Returns:
    mark of order sending succeed or not: succeed true, failed false
  Throws:
    `RFIDException`

### SetDO

    public boolean SetDO(byte port,
                         byte state)
                  throws RFIDException

  set Digital Output status

  Parameters:
    `port` - the setting port 0 or 1
    `state` - status value 0 or 1
  Returns:
    mark of order sending succeed or not: succeed true, failed false
  Throws:
    `RFIDException`

### GetDI

    public java.lang.String GetDI()

  get Digital Input status

  Returns:
    DI data character string

### KillTag

    public boolean KillTag(java.lang.String pKill_pwd,
                           java.lang.String access_pwd)
                    throws RFIDException

  kill tag

  Parameters:
    `pKill_pwd:` - kill password
    `access_pwd:` - access password
  Returns:
    mark of order sending succeed or not: succeed: true, failed:false
  Throws:
    `RFIDException`

### lockTag

    public boolean lockTag(int opcode,
                           int block,
                           java.lang.String password)
                    throws RFIDException

  lock tag

  Parameters:
    `opcode:` - operation code, 0: unlock; 1: permanence_writalbe, 2:security_lock; 3: permanence_unwriable
    `block` - operation area
    `password` - operation password
  Returns:
    mark of order sending succeed or not: succeed true, failed false
  Throws:
    `RFIDException`

### close

    public void close()

Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD