From af65dd94bd47bba79fe652c65139ca3292fc2547 Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Sat, 20 Oct 2001 13:08:23 +0000 Subject: [PATCH] =?UTF-8?q?2001-10-20=20Lutz=20M=EF=BF=BDller=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libgphoto2/gphoto2-camera.[c,h] (gp_camera_get_port_speed): New git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2656 67ed7778-7388-44ab-90cf-0a291f65f57c --- ChangeLog | 4 ++++ libgphoto2/gphoto2-camera.c | 18 ++++++++++++++++++ libgphoto2/gphoto2-camera.h | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 87801e30e..2f9558ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-10-20 Lutz Müller + + * libgphoto2/gphoto2-camera.[c,h] (gp_camera_get_port_speed): New + 2001-10-20 Lutz Müller * camlibs/kodak/dc240/library.c: Don't access a CameraFile directly. diff --git a/libgphoto2/gphoto2-camera.c b/libgphoto2/gphoto2-camera.c index 09572493f..71cd0731d 100644 --- a/libgphoto2/gphoto2-camera.c +++ b/libgphoto2/gphoto2-camera.c @@ -69,6 +69,7 @@ struct _CameraPrivateCore { /* Some information about the port */ char port_name[1024]; char port_path[1024]; + unsigned int speed; CameraStatusFunc status_func; void *status_data; @@ -391,10 +392,27 @@ gp_camera_set_port_speed (Camera *camera, int speed) CHECK_RESULT (gp_port_settings_get (camera->port, &settings)); settings.serial.speed = speed; CHECK_RESULT (gp_port_settings_set (camera->port, settings)); + camera->pc->speed = speed; return (GP_OK); } +/** + * gp_camera_get_port_speed: + * @camera: a #Camera + * + * Retreives the current speed. + * + * Return value: The current speed or a gphoto2 error code + **/ +int +gp_camera_get_port_speed (Camera *camera) +{ + CHECK_NULL (camera); + + return (camera->pc->speed); +} + /** * gp_camera_set_progress_func: * @camera: a #Camera diff --git a/libgphoto2/gphoto2-camera.h b/libgphoto2/gphoto2-camera.h index 3b004fd12..cd4c88b3f 100644 --- a/libgphoto2/gphoto2-camera.h +++ b/libgphoto2/gphoto2-camera.h @@ -151,8 +151,12 @@ int gp_camera_get_port_name (Camera *camera, const char **port_name); int gp_camera_set_port_path (Camera *camera, const char *port_path); int gp_camera_get_port_path (Camera *camera, const char **port_path); -/* Don't use */ +/* + * You normally don't use that. If you do, you prevent the camera driver + * from selecting the optimal speed + */ int gp_camera_set_port_speed (Camera *camera, int speed); +int gp_camera_get_port_speed (Camera *camera); /************************************************************************ * Part I: *