0

I'm trying to read data from Bio-metric device Using Socket Object following this Link . When I run code, Device seems stop working. And Connection status return true. But no Data print.

What is the problem with this code? Please, someone suggest me.

I'm trying like this...

public void readDataFromDevice(){
   try{
      System.out.println("<-----Read Data From Device------>");

      String host = "192.168.0.113";
      Socket requestSocket = new Socket(host, 4370);
      System.out.println("Socket status : " + requestSocket.isConnected());

      BufferedReader in = new BufferedReader(new InputStreamReader(requestSocket.getInputStream()));
      in.lines().forEach((l)->{
         System.out.println("Data => "+l);
      });
   }catch(UnknownHostException e){
      e.printStackTrace();
   }catch(ConnectException e){
      e.printStackTrace();
   }catch(IOException e){
      e.printStackTrace();
   }catch(Exception e){
      e.printStackTrace();
   }
}

And Here its output...

OutPut

Thanks..

Abu Bakar Siddik
  • 487
  • 1
  • 7
  • 16

1 Answers1

0

Hope you are using ZKTeco devices. ZkTeco devices are launched only with windows SDK. You can download the SDK from https://www.zkteco.com/en/download_catgory.html and use the DLL in java which can run only on Windows platorm. For HTTP communication, to work in any platform through any language, refer http://camsunit.com/application/zk-teco-essl-api-integration.html

Ravanan
  • 536
  • 2
  • 13