Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_camera_set_abilities ( Camera camera,
CameraAbilities  abilities 
)

Sets the camera abilities.

Parameters:
camera a Camera
abilities the CameraAbilities to be set
Returns:
a gphoto2 error code
You need to call this function before calling gp_camera_init the first time unless you want gphoto2 to autodetect cameras and choose the first detected one. By setting the abilities, you tell gphoto2 what model the camera is and what camera driver should be used for accessing the camera. You can get abilities by calling gp_abilities_list_get_abilities.

Definition at line 383 of file gphoto2-camera.c.

References CHECK_NULL, gp_camera_exit(), gp_log(), GP_LOG_DEBUG, GP_OK, and CameraAbilities::model.

Referenced by gp_camera_init().

{
      gp_log (GP_LOG_DEBUG, "gphoto2-camera", "Setting abilities ('%s')...",
            abilities.model);

      CHECK_NULL (camera);

      /*
       * If the camera is currently initialized, terminate that connection.
       * We don't care if we are successful or not.
       */
      if (camera->pc->lh)
            gp_camera_exit (camera, NULL);

      memcpy (&camera->pc->a, &abilities, sizeof (CameraAbilities));

      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index