RFID reader

Use the method below to open RFID chip reading controller and start its processing:

#1

Java
Kotlin
Java
DocumentReader.Instance().startRFIDReader(MainActivity.this, new IDocumentReaderCompletion() {
@Override
public void onCompleted(int rfidAction, DocumentReaderResults results, Throwable error) {
// do something
}
});
Kotlin
DocumentReader.Instance().startRFIDReader(this@MainActivity) { rfidAction, results_RFIDReader, _ ->
// do something
}

#2

Java
Java
DocumentReader.Instance().startRFIDReader(MainActivity.this, documentReaderCompletion, rfidReaderRequest);
private IDocumentReaderCompletion documentReaderCompletion = new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, DocumentReaderResults results, DocumentReaderException error) {
// do something
}
};
private IRfidReaderRequest rfidReaderRequest = new IRfidReaderRequest() {
@Override
public void onRequestPACertificates(byte[] serialNumber, PAResourcesIssuer issuer, IRfidPKDCertificateCompletion completion) {
// do something
}
@Override
public void onRequestTACertificates(String keyCAR, IRfidPKDCertificateCompletion completion) {
// do something
}
@Override
public void onRequestTASignature(TAChallenge challenge, IRfidTASignatureCompletion completion) {
// do something
}
};

#3

Java
Java
DocumentReader.Instance().startRFIDReader(MainActivity.this, documentReaderCompletion, null, rfidNotificationCompletion);
private IDocumentReaderCompletion documentReaderCompletion = new IDocumentReaderCompletion() {
@Override
public void onCompleted(int action, DocumentReaderResults results, DocumentReaderException error) {
// do something
}
};
private IRfidNotificationCompletion rfidNotificationCompletion = new IRfidNotificationCompletion() {
@Override
public void onRfidNotification(int notificationType, @Nullable @org.jetbrains.annotations.Nullable Bundle value) {
Log.d("MainActivity", "RFID notification: " + notificationType + ", value: " + value);
}
};

Use the method below to stop RFID chip reading programmatically:

Java
Kotlin
Java
DocumentReader.Instance().stopRFIDReader(MainActivity.this);
Kotlin
DocumentReader.Instance().stopRFIDReader(this@MainActivity)