【问题标题】:RFID reader communicationRFID阅读器通信
【发布时间】:2014-04-20 23:06:58
【问题描述】:

我有 RFID 阅读器 ZK-RFID101,当我购买它时,它带有一个 SDK,用于开发和与阅读器通信,但是当我尝试使用它时它无法工作,我没有收到来自阅读器的任何信息

public class Reader18 {

    /**
     * @param arr
     * @return 
     */
    public native int[] OpenComPort(int[]arr);
    public native int[] AutoOpenComPort(int[]arr);
    public native int CloseComPort();
    public native int[] OpenNetPort(int addr,int Port,String IPaddr);
    public native int CloseNetPort(int Port);
    public native int CloseSpecComPort(int Frmhandle);
    public native int[] GetReaderInformation(int[]arr);
    public native int SetWGParameter(int[]arr);
    public native int[] ReadActiveModeData(int[]arr);
    public native int SetWorkMode(int[]arr);
    public native int[] GetWorkModeParameter(int[]arr);
    public native int BuzzerAndLEDControl(int[] arr);
    public native int WriteComAdr(int[] arr);
    public native int SetPowerDbm(int[] arr);
    public native int Writedfre(int[] arr);
    public native int Writebaud(int[] arr);
    public native int WriteScanTime(int[] arr);
    public native int SetAccuracy(int[] arr);
    //EPC  G2
    public native int[] Inventory_G2(int[]arr);
    public native int[] ReadCard_G2(int[]arr);
    public native int[] WriteCard_G2(int[]arr);
    public native int[] EraseCard_G2(int[]arr);
    public native int[] SetCardProtect_G2(int[]arr);
    public native int[] DestroyCard_G2(int[]arr);
    public native int[] WriteEPC_G2(int[]arr);
    public native int[] SetReadProtect_G2(int[]arr);
    public native int[] SetMultiReadProtect_G2(int[]arr);
    public native int[] RemoveReadProtect_G2(int[]arr);
    public native int[] CheckReadProtected_G2(int[]arr);
    public native int[] SetEASAlarm_G2(int[]arr);
    public native int[] CheckEASAlarm_G2(int[]arr);
    public native int[] LockUserBlock_G2(int[]arr);
    //18000_6B
    public native int[] Inventory_6B(int[]arr);
    public native int[] inventory2_6B(int[]arr);
    public native int[] ReadCard_6B(int[]arr);
    public native int[] WriteCard_6B(int[]arr);
    public native int[] LockByte_6B(int[]arr);
    public native int[] CheckLock_6B(int[]arr);

    public static void main(String[] args) {
        Reader18 test = new Reader18();
        int[] a = new int[2];
        int[] b;



        a[0]=0xff;
        a[1]=0;




      b=test.AutoOpenComPort(a);

        ///for(int i=0; i <b.length; i++)
            System.out.println(b.length);








        System.out.println();



    }

    static {
         // we need to have the dll file in the same folder as Reader18.java
         // it is to be noted that the Reader18.class should be kept in UHF folder due to package statement.
         // but the dll file should be in the folder where UHF folder is present.
         // System.loadLibrary("UHF_Reader18"); 

         System.load("C:\\Users\\Abdulaziz\\Desktop\\UHF\\Libraryes\\UHF_Reader18.dll");
     }

}  

这是阅读器附带的 .DLL 文件。

http://www.4shared.com/file/XKxPYxG3ce/UHF_Reader18.html

【问题讨论】:

    标签: dll tags communication rfid


    【解决方案1】:

    您应该与设备制造商联系以获得支持。没有人可以仅通过查看提供的 dll 中的方法签名来回答您的问题。

    【讨论】:

      【解决方案2】:

      我有同样的 RFID 阅读器,我遇到了同样的问题,所以如果你到现在还没有解决问题,我想告诉你我尝试了很多东西,最后我只通过包含“基本.dll” - 他们与 SDK 一起发送 - 在存在“UHF_Reader18.dll”的同一文件夹中,因为它们之间似乎存在依赖关系,但只加载“UHF_Reader18.dll”。

      在我联系他们之后,他们给我发了一个代码来测试,但是在这里你应该创建一个包然后将它导入一个新项目,并且不要忘记将包(你也将编译)放在 src 中新项目的文件夹。

      对于您在其中创建包的项目,将包命名为 UHF 及其类 Reader18,然后将 Reader18.java 的内容(他们在没有任何添加的情况下发送)复制并粘贴到该类中,然后将其编译为获取Reader18.class,然后将UHF_Reader18.dll和Basic.dll放在本项目“src”后面的“UHF”中。

      在新项目的“src”中包含该包的所有项目后,使用以下代码创建一个新项目,并注意 dll 文件的路径。

      您可以使用以下代码测试功能,其中包括导入该包:

          import UHF.Reader18.*;
      public class Main {
      
          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              // TODO code application logic here
          //    System.out.println(System.getProperty("java.library.path"));
           System.loadLibrary("UHF_Reader18");
             UHF.Reader18 tnt = new UHF.Reader18();
              int arr[];
              arr=new int[3];
              int arr1[]=new int[80];
             // arr1=new byte[8];
              arr[0]=1;//serial port
      
              arr[1]=1;//Read/write device address
      
              arr[2]=5;//Baud rate
              arr1=tnt.OpenComPort(arr);
            //   arr1=tnt.OpenNetPort(255, 6000, "192.168.3.11");
               for (int m=0;m<arr1.length;m++)
              {
                 System.out.println(arr1[m]);
              }///
              arr[0]=1;//address
      
              arr[1]=1;//handle
              arr1=tnt.Inventory_G2(arr);
              for (int m=0;m<arr1.length;m++)
              {
                 System.out.println(arr1[m]);
              }
          }
      
      }  
      

      希望对您有所帮助。

      【讨论】:

      • 您好,我遇到了相同的 dll 和天线问题,我无法通过 OpenNetPort 方法完成连接,如果您对此有所了解,我将不胜感激,您可以联系我。
      • 你能说出文件的完整结构吗?我真的很困惑,现在我被困了 2 天
      猜你喜欢
      • 2015-09-20
      • 2017-05-22
      • 1970-01-01
      • 1970-01-01
      • 2016-02-28
      • 1970-01-01
      • 1970-01-01
      • 2019-07-28
      • 1970-01-01
      相关资源
      最近更新 更多