IBcmCalibrationDelegate
The calibration delegate receives messages about calibration progress and results by BcmCalibrationActivity or BcmCalibrationFragment . It provides your application with the calibration 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:
/**
* Calibration delegate - callback from the SDK related to the device calibration
*/
interface IBcmCalibrationDelegate {
public enum class CalibrationError {
/**
* An internal error occurred, please inspect the logs for details
*/
Unknown,
/**
* The camera cannot be used due to user or device restrictions
*/
CameraProblem,
}
/**
* Something went terribly wrong (as indicated by errorCode) and things are now broken.
* Notify your user.
*/
fun unrecoverableError(
errorCode: CalibrationError,
errorMessage: String
)
/**
* The calibration has completed.
* Inspect the BcmCalibration structure to check the calibration data callback.
*/
fun calibrationResult(
deviceCalibrationData: BcmDeviceCalibration
)
/**
* Optional
*/
/**
* Setup has completed and calibration can be started.
*/
fun readyToCalibrate() {
}
/**
* Callback when the camera is ready.
* This callback additionally includes the information about the selected
* frame width and height
*/
fun cameraIsReady(
cameraFrameWidth: Int,
cameraFrameHeight: Int
) {
}
}
Usage
Implement at least IBcmCalibrationDelegate.unrecoverableError()
and IBcmCalibrationDelegate.calibrationResult() for receiving calibration results.