Interface DeviceRetrievalHelper.Listener
-
- Enclosing class:
- DeviceRetrievalHelper
public static interface DeviceRetrievalHelper.Listener
Interface for listening to messages from the remote verifier device.The
onError(Throwable)
callback can be called at any time - for example - if the remote verifier disconnects without using session termination or if the underlying transport encounters an unrecoverable error.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onDeviceDisconnected(boolean transportSpecificTermination)
Called when the remote verifier device disconnects normally, that is using the session termination functionality in the underlying protocols.void
onDeviceRequest(byte[] deviceRequestBytes)
Called when the remote verifier device sends a request.void
onError(java.lang.Throwable error)
Called when an unrecoverable error happens, for example if the remote device disconnects unexpectedly (e.g.
-
-
-
Method Detail
-
onDeviceRequest
void onDeviceRequest(@NonNull byte[] deviceRequestBytes)
Called when the remote verifier device sends a request.The
deviceRequestBytes
parameter contains the bytes ofDeviceRequest
CBOR as specified in ISO/IEC 18013-5 section 8.3 Device Retrieval.The application should use
DeviceRequestParser
to parse the request andDeviceResponseGenerator
to generate a response to be sent usingDeviceRetrievalHelper.sendDeviceResponse(byte[])
. Alternatively, the application may also choose to terminate the session usingDeviceRetrievalHelper.disconnect()
.- Parameters:
deviceRequestBytes
- the device request.
-
onDeviceDisconnected
void onDeviceDisconnected(boolean transportSpecificTermination)
Called when the remote verifier device disconnects normally, that is using the session termination functionality in the underlying protocols.If this is called the application should call
DeviceRetrievalHelper.disconnect()
and the object should no longer be used.- Parameters:
transportSpecificTermination
- set totrue
if the termination mechanism used was transport specific.
-
onError
void onError(@NonNull java.lang.Throwable error)
Called when an unrecoverable error happens, for example if the remote device disconnects unexpectedly (e.g. without first sending a session termination request).If this is called the application should call
DeviceRetrievalHelper.disconnect()
and the object should no longer be used.- Parameters:
error
- the error.
-
-