IBcmFlowDelegate
The scan flow delegate receives messages about scan progress and results by BcmScanActivity or BcmScanFragment. It provides your application with the scan result or error, including environment-related errors such as the lack of camera permissions.
You may provide your own scan flow by implementing the following interface:
Interface
Kotlin:
/**
* Scan flow delegate - callback from the SDK
* When running code - which have to run on the main thread - you've to dispatch the code block
* to the main thread
*/
interface IBcmFlowDelegate {
public enum class BcmScanError {
/**
* There is a problem with the given license key.
* Please also check the network connection - a network connection is mandatory.
*/
LICENSE_PROBLEM,
/**
* No pre-calibration configuration for the device was found.
*/
DEVICE_NOT_CALIBRATED,
/**
* An internal error occurred, please inspect the logs for details.
*/
UNKNOWN,
/**
* The camera cannot be used due to an error.
*/
CAMERA_PROBLEM,
/**
* Presentation attack detected.
*/
PAD_DETECTED,
}
/**
* Something went terribly wrong (as indicated by errorCode) and things are now broken.
* Notify your user.
*/
fun bcmUnrecoverableError(
errorCodeBcm: BcmScanError,
errorMessage: String
)
/**
* A scan has completed.
* Inspect the BcmFingerImage structure to check the recorded fingerprints.
* The scan termination can be configured via the `IBcmSdkConfig`
*/
fun bcmFingerImagesResult(
fingerImages: Set<BcmFingerImage>
)
/**
* Optional
*/
/**
* Finger selection dialog callback.
* The callback contains a set of all finger selected in the Finger selection dialog.
*/
fun bcmFingerSelected(
excludedFingers: Set<BcmFingerHand>,
selectedFingers: Set<BcmFingerHand>
) {
}
/**
* Setup has completed and fingers may now be scanned.
*/
fun bcmReadyToScan() {
}
/**
* Callback when the camera is ready.
* This callback additionally includes the information about
* the device calibration data and the selected frame width and height
*/
fun bcmCameraIsReady(
deviceCalibration: BcmDeviceCalibration,
cameraFrameWidth: Int,
cameraFrameHeight: Int
) {
}
/**
* Hand recognized.
* Inspect the hand structure for the object details.
* The callback includes a count of the founded fingers.
* The distance is a value in the rage (0 - 1.0) (far - close)
* The callback will continuously called, during the scan.
*
* Optional
*/
fun bcmHandDetected(
hand: Hand,
fingerCount: Int,
distance: Float
)
/**
* Fingers are recognized on the given preview position with a given evaluation score.
* Inspect the AssignedBoundingBox structure for the object details.
* The callback will continuously called, during the scan.
*/
fun bcmBoundingBoxesAssigned(
assignedBoundingBoxes: Set<AssignedBoundingBox>
) {
}
/**
* Internal finger cache was updated, because fingers with a better score was detected.
* Inspect the BcmFingerImageLiveScore structure to check live score.
* The callback will continuously called, during the scan.
*/
fun bcmFingerImagesCachedLiveScore(
fingerImageLiveScores: Set<BcmFingerImageLiveScore>
) {
}
}
Usage
Implement at least IBcmFlowDelegate.unrecoverableError()
and IBcmFlowDelegate.fingerImagesResult() for receiving scan results.
Using the IBcmFlowDelegate.fingerImagesCachedLiveScore() it is possible to implement your own scan
termination logic. Please refer to Custom Scan Termination
for an example implementation.