Reputation: 1
i have RFID reader ZK-RFID101 and when i bought it it came with a SDK to develop and communicate with the reader but when i am trying to use it it wont work, i don't receive any information from the reader
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");
}
}
this is the .DLL file that came with the reader.
http://www.4shared.com/file/XKxPYxG3ce/UHF_Reader18.html
Upvotes: 0
Views: 3066
Reputation: 1
I have the same RFID reader and I faced the same problem, so if you didn't solved the problem till now, I would like to inform you that I tried many things and finally I solved it by just including the "Basic.dll" -which they sent with the SDK- in the same folder where "UHF_Reader18.dll" is present, because it seems there is a dependency between them, but only load "UHF_Reader18.dll".
And after I contacted them they sent me a code to test, but here you should create a package then import it to a new project, and don't forget to place the package (that you would compile also) inside the src folder of the new project.
For the project you create the package in, name the package UHF, and its class Reader18, then copy and paste the contents of Reader18.java (which they sent without any addition from you) inside this class, then compile it to get Reader18.class, then place UHF_Reader18.dll and Basic.dll in "UHF" after "src" of this project.
Make a new project with the code -below- after you include all the project of that package inside "src" of the new project, and be aware of the path of the dll file.
You can test the functions with the following code which includes importing that package:
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]);
}
}
}
Hoping that was helpful.
Upvotes: 0
Reputation: 34407
You should talk to the device manufacturer for the support. Nobody can answer your question just by looking at the method signatures from dll provided.
Upvotes: 1