pub async fn camera_factory_method_to_fidl(
    method_name: String,
    args: Value,
    facade: &CameraFactoryFacade,
) -> Result<Value, Error> {
    let result = match method_name.as_ref() {
        "DetectCamera" => facade.detect_camera().await,
        "Init" => facade.init().await,
        "Start" => facade.start().await,
        "Stop" => facade.stop().await,
        "SetConfig" => {
            let req: SetConfigRequest = from_value(args)?;
            facade.set_config(req.mode, req.exposure, req.analog_gain, req.digital_gain).await
        }
        "CaptureImage" => facade.capture_image().await,
        "WriteCalibrationData" => {
            let mut req: WriteCalibrationDataRequest = from_value(args)?;
            facade.write_calibration_data(&mut req.calibration_data, req.file_path).await
        }
        _ => bail!("invalid FIDL method: {}", method_name),
    }?;
    Ok(result)
}
/// Takes JSON-RPC method command and forwards to corresponding CameraFactory FIDL methods.
Takes JSON-RPC method command and forwards to corresponding CameraFactory FIDL methods.
Takes JSON - RPC method command and forwards to corresponding CameraFactory FIDL methods .
pub async fn camera_factory_method_to_fidl(
    method_name: String,
    args: Value,
    facade: &CameraFactoryFacade,
) -> Result<Value, Error> {
    let result = match method_name.as_ref() {
        "DetectCamera" => facade.detect_camera().await,
        "Init" => facade.init().await,
        "Start" => facade.start().await,
        "Stop" => facade.stop().await,
        "SetConfig" => {
            let req: SetConfigRequest = from_value(args)?;
            facade.set_config(req.mode, req.exposure, req.analog_gain, req.digital_gain).await
        }
        "CaptureImage" => facade.capture_image().await,
        "WriteCalibrationData" => {
            let mut req: WriteCalibrationDataRequest = from_value(args)?;
            facade.write_calibration_data(&mut req.calibration_data, req.file_path).await
        }
        _ => bail!("invalid FIDL method: {}", method_name),
    }?;
    Ok(result)
}
pub async fn camera_factory_method_to_fidl ( method_name : String , args : Value , facade : & CameraFactoryFacade , ) -> Result < Value , Error > { let result = match method_name . as_ref ( ) { " " => facade . detect_camera ( ) . await , " " => facade . init ( ) . await , " " => facade . start ( ) . await , " " => facade . stop ( ) . await , " " => { let req : SetConfigRequest = from_value ( args ) ? ; facade . set_config ( req . mode , req . exposure , req . analog_gain , req . digital_gain ) . await } " " => facade . capture_image ( ) . await , " " => { let mut req : WriteCalibrationDataRequest = from_value ( args ) ? ; facade . write_calibration_data ( & mut req . calibration_data , req . file_path ) . await } _ => bail ! ( " " method_name ) , } ? ; Ok ( result ) }
Takes JSON-RPC method command and forwards to corresponding CameraFactory FIDL methods.
Takes JSON - RPC method command and forwards to corresponding CameraFactory FIDL methods .
method_name
String
args
Value
facade
&CameraFactoryFacade