IBcmFlowDelegate

The scan flow delegate receives messages about scan progress and results by BcmScanActivity. 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:

interface IBcmFlowDelegate {

    public enum class ScanError {
        /**
         * There is a problem with the given license key.
         * Please also check the network connection - a network connection is mandatory.
         */
        ScanErrorLicenseProblem,

        /**
         * No pre-calibration configuration for the device was found.
         */
        ScanErrorDeviceNotCalibrated,

        /**
         * An internal error occurred, please inspect the logs for details.
         */
        ScanErrorUnknown,

        /**
         * The camera cannot be used due to an error.
         */
        ScanErrorCameraProblem,
    }

    /**
     * Something went terribly wrong (as indicated by errorCode) and things are now broken.
     * Notify your user.
     */
    fun unrecoverableError(
        errorCode: ScanError,
        errorMessage: String
    )

    /**
     * A scan has completed.
     * Inspect the BcmFingerImageDTO structure to check the recorded fingerprints.
     * The scan termination can be configured via the `IBcmSdkConfig`
     */
    fun fingerImagesResult(
        fingerImages: Set<BcmFingerImageDTO>
    )

    /**
     * Optional
     */
    /**
     * Finger selection dialog callback.
     * The callback contains a set of all finger selected in the Finger selection dialog.
     */
    fun fingerSelected(
        fingerSelection: Set<BcmFingerHandDTO>
    ) {
    }

    /**
     * Setup has completed and fingers may now be scanned.
     */
    fun readyToScan() {
    }

    /**
     * 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 cameraIsReady(
        deviceCalibrationDTO: BcmDeviceCalibrationDTO,
        cameraFrameWidth: Int,
        cameraFrameHeight: Int
    ) {
    }

    /**
     * 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 boundingBoxesAssigned(
        assignedBoundingBoxes: Set<AssignedBoundingBox>
    ) {
    }

    /**
     * Internal finger cache was updated, because fingers with a better score was detected.
     * Inspect the BcmFingerImageLiveScoreDTO structure to check live score.
     * The callback will continuously called, during the scan.
     */
    fun fingerImagesCachedLiveScore(
        fingerImageLiveScores: Set<BcmFingerImageLiveScoreDTO>
    ) {
    }

}

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.

See Also

results matching ""

    No results matching ""