0
votes

It has two types of RFID readers pcProx Plus. One connected via USB, the other via Ethernet. I managed to correctly connect to the first reader connected via USB, using the com.fazecast.jSerialComm library. I am able to correctly read the number of the card attached to the reader. I would like to do the same, but for a reader connected via Ethernet. In pcProxConfig I'm able to connect to it by entering IP address and port. Is the only solution to purchase the paid SDK https://www.rfideas-shop.com/en/dk-pcprx-download-pcprox-universal-software-develo.html ?

Does anyone have a working example of a program that properly connects to such a reader via Ethernet connection ?

1

1 Answers

0
votes

this is an example of the connection to the reader:

try (Socket client = new Socket(hostname, port)) {

        client.setSoTimeout(10 * 1000);

        InputStreamReader stream = new InputStreamReader(client.getInputStream());
        String strData = "";
        long endTime = System.currentTimeMillis() + 10000;
        while (System.currentTimeMillis() < endTime) {

            char[] data = new char[1024];

            int numBytesRead = 0;

            try {
                numBytesRead = stream.read(data, 0, data.length);
            } catch (java.lang.Exception e) {
            }

            strData += String.valueOf(data, 0, numBytesRead);

        }

        System.out.println(strData);

    } catch (Exception ex) {

    }