summaryrefslogtreecommitdiff
path: root/libgphoto2_port/libgphoto2_port
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2013-03-10 18:38:06 +0000
committerMarcus Meissner <marcus@jet.franken.de>2013-03-10 18:38:06 +0000
commit0e53034953fbe25be116dcb82a4e18ea4f9d1247 (patch)
tree72b8a05b4722cd939250768df2a834de629d2898 /libgphoto2_port/libgphoto2_port
parent5bb1a006f31d9901beddc23579bf14cddccc6358 (diff)
downloadlibgphoto2-0e53034953fbe25be116dcb82a4e18ea4f9d1247.tar.gz
implemented a gp_port_reset() function
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14277 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/libgphoto2_port')
-rw-r--r--libgphoto2_port/libgphoto2_port/gphoto2-port.c22
-rw-r--r--libgphoto2_port/libgphoto2_port/libgphoto2_port.ver1
2 files changed, 23 insertions, 0 deletions
diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port.c b/libgphoto2_port/libgphoto2_port/gphoto2-port.c
index 0eca7c568..65f73a906 100644
--- a/libgphoto2_port/libgphoto2_port/gphoto2-port.c
+++ b/libgphoto2_port/libgphoto2_port/gphoto2-port.c
@@ -300,6 +300,28 @@ gp_port_close (GPPort *port)
}
/**
+ * \brief Reset a port.
+ * \param port a #GPPort
+ *
+ * Resets a port. Device will likely reconnect and appear under a new id.
+ *
+ * \return a gphoto2 error code
+ **/
+int
+gp_port_reset (GPPort *port)
+{
+ gp_log (GP_LOG_DEBUG, "gphoto2-port", _("Resetting port..."));
+
+ CHECK_NULL (port);
+ CHECK_INIT (port);
+
+ CHECK_SUPP (port, "reset", port->pc->ops->reset);
+ CHECK_RESULT (port->pc->ops->reset(port));
+
+ return (GP_OK);
+}
+
+/**
* \brief Free the port structure
* \param port a #GPPort
*
diff --git a/libgphoto2_port/libgphoto2_port/libgphoto2_port.ver b/libgphoto2_port/libgphoto2_port/libgphoto2_port.ver
index a05434230..893a9e6b9 100644
--- a/libgphoto2_port/libgphoto2_port/libgphoto2_port.ver
+++ b/libgphoto2_port/libgphoto2_port/libgphoto2_port.ver
@@ -32,6 +32,7 @@ LIBGPHOTO2_5_0 {
gp_port_open;
gp_port_read;
gp_port_result_as_string;
+ gp_port_reset;
gp_port_seek;
gp_port_send_break;
gp_port_send_scsi_cmd;