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

int gp_camera_set_abilities ( Camera *  camera,
CameraAbilities  abilities 
)

gp_camera_set_abilities: : a Camera : the CameraAbilities to be set

Sets the camera abilities. 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 , you tell gphoto2 what model the is and what camera driver should be used for accessing the . You can get by calling gp_abilities_list_get_abilities.

Return value: a gphoto2 error code

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

References gp_camera_exit().

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