0

I’d like to connect to the device from an Android app. I already managed to authorize successfully. Now I would like to start the automatic polling as described in the reference (Request command: E0 00 00 40 01, Page 30, https://www.acs.com.hk/download-manual/7664/REF-ACR1255U-J1-1.12.pdf) but I don’t get it.

I think, I have to encrypt the request to the reader. Is this correct? If yes, which key do I have to use? Comes the key (session key?) from the final response within the authorization flow?

For testing I used the demo app (https://www.acs.com.hk/download-driver-unified/9644/ACS-BT-EVK-Android-1.01r2.zip) and Wireshark to record the requests. I was very surprised to find that the request would change every time once I clicked the "start polling" button. I would expect it to be the same, no matter how often I click.

I would appreciate a more helpful explanation of the start polling command than the one I can find in the reference.

somanyquestions
  • 81
  • 1
  • 1
  • 8

1 Answers1

0

I just created an auto polling command :

private static final byte[] AUTO_POLLING_START = {(byte) 0xE0, 0x00, 0x00, 0x40, 0x01};

then a function that I am executing in onAuthenticationComplete listener, after successful authentication

private void startPolling() {

    if (bluetoothReader == null) {
        authStatus.setText("Card reader not ready");
        return;
    }
    if (!bluetoothReader.transmitEscapeCommand(AUTO_POLLING_START)) {
        authStatus.setText("Card reader not ready");
    }
}
bluetoothReader.setOnAuthenticationCompleteListener(new BluetoothReader.OnAuthenticationCompleteListener() {
            @Override
            public void onAuthenticationComplete(BluetoothReader bluetoothReader, final int errorCode) {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        if (errorCode == BluetoothReader.ERROR_SUCCESS) {
                            authStatus.setText("Authentication Success!");
                            startPolling();

                        } else {
                            authStatus.setText("Authentication Failed!");
                        }
                    }
                });
            }
        });
Pesa
  • 241
  • 1
  • 3
  • 8