I am trying to connect to the Biometric fingerprint recorder using a Java program. The device I'm using is the Pegasus T5 fingerprint scanner . Unfortunately, their SDK for this device ( which can be downloaded here ) covers only C #, Net and VB, which I have no experience with. And when I asked the manufacturers, they replied that there was no Java SDK for the device . Despite the fact that I do not know any of these languages, I tried to understand the codes in the SDK to find out how the device connects, and I saw that it simply connects to the device using the network ip and port number.
If you reference the C # device SDK, you can see the example I saw on this in frmEvent.cs, which in the method cmdStartMoniter_Clickmakes the connection as follows.
bRet = bpc.StartEventCapture(0, util.pubIPAddrToLong(txtSourceIP.Text), Convert.ToInt32(txtPortNumber.Text));
And this applies to a method StartEventCapturelike public virtual bool StartEventCapture(int dwCommType, int dwParam1, int dwParam2);, which is in the DLL file as it appears, and which I lost my track, because I have additional knowledge on how to define the code.
However, retaining this example that I saw in my head, as my next step, I began to study the global standard on how to connect, send and retrieve data using a fingerprint device, which again I was not lucky to find a clear solution. But with some examples of some people who tried to deal with the same and an example that I myself saw, I tried to connect to the device by creating an object Socket, but when I executed it, it only led to the fact thatjava.net.ConnectException: Connection timed out: connect
There are four questions
- Is there a Java SDK for biometric fingerprint detection devices that I can use for my device?
- Is there a common standard way to connect, send and receive data from such a device using Java?
Socket , - , , ?- , , , , ?
, .
String host = "192.168.168.100";
int port = Integer.parseInt("5005");
try {
Socket socket = new Socket(host, port);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line;
while (true){
line = in.readLine();
if (line != null){
System.out.println(line);
}
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}