gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-12


From: Pawel Kot
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-121-g6358145
Date: Wed, 26 Jan 2011 20:36:58 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  635814554b35b81e3c8747e01a181d2ef3f6fa1f (commit)
      from  ae1cd3b0d803ffa75fab7c29c01b1cd6d391c7b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=635814554b35b81e3c8747e01a181d2ef3f6fa1f


commit 635814554b35b81e3c8747e01a181d2ef3f6fa1f
Author: Pawel Kot <address@hidden>
Date:   Wed Jan 26 12:35:12 2011 -0800

    Add gn_lib_phone_change_driver() to allow for changes of the phone
    driver during runtime.

diff --git a/ChangeLog b/ChangeLog
index e6bdbbe..cd60c3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 0.6.31 (not released yet)
 =========================
+ * libgnokii updates
+    o add gn_lib_phone_change_driver() function to allow replacing
+      used driver in runtime                            (Paweł Kot)
  * nk6510 driver updates
     o fix calendar handling issues (few off-by-ones)    (Paweł Kot)
 
diff --git a/common/libfunctions.c b/common/libfunctions.c
index 3c5ca40..dd1af53 100644
--- a/common/libfunctions.c
+++ b/common/libfunctions.c
@@ -621,3 +621,23 @@ GNOKII_API gn_error 
gn_lib_search_one_connected_phone(struct gn_statemachine **s
        return GN_ERR_NOTIMPLEMENTED;
 }
 
+GNOKII_API gn_error gn_lib_phone_change_driver(struct gn_statemachine *state, 
const char* driver)
+{
+       gn_error error;
+
+       /* terminate the connection */
+       error = gn_lib_phone_close(state);
+       if (error != GN_ERR_NONE)
+               return error;
+       error = gn_lib_phoneprofile_free(&state);
+       if (error != GN_ERR_NONE)
+               return error;
+
+       /* change the driver */
+       error = gn_cfg_phone_load(driver, state);
+       if (error != GN_ERR_NONE)
+               return error;
+
+       /* initialize new connection */
+       return gn_lib_phone_open(state);
+}
diff --git a/include/gnokii.h.in b/include/gnokii.h.in
index 7e56f0d..aedb024 100644
--- a/include/gnokii.h.in
+++ b/include/gnokii.h.in
@@ -121,6 +121,14 @@ GNOKII_API gn_error gn_lib_phone_open(struct 
gn_statemachine *state);
 /* closes the connection to the phone */
 GNOKII_API gn_error gn_lib_phone_close(struct gn_statemachine *state);
 
+/*
+ * Changes the driver used for connection.
+ * It closes the existing one and initializes new one.
+ * The new driver must be present in the parsed configuration (this function 
does not reread the config).
+ * @driver is the name of the phone section from the config.
+ */
+GNOKII_API gn_error gn_lib_phone_change_driver(struct gn_statemachine *state, 
const char *driver);
+
 /* ask phone for static information (model, manufacturer, revision and imei) */
 GNOKII_API const char *gn_lib_get_phone_model       (struct gn_statemachine 
*state); /* e.g. 6310 */
 GNOKII_API const char *gn_lib_get_phone_product_name(struct gn_statemachine 
*state); /* e.g. NPE-4 */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    3 +++
 common/libfunctions.c |   20 ++++++++++++++++++++
 include/gnokii.h.in   |    8 ++++++++
 3 files changed, 31 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]