[PATCH] add posibility to handle custom init response for plugins



From: Tom Bechtold <toabctl googlemail com>

---
 src/mm-plugin-base.c |    8 ++++++++
 src/mm-plugin-base.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 8d32e2a..b1e6c0d 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -745,6 +745,13 @@ custom_init_response (MMAtSerialPort *port,
                 return;
             }
         }
+    } else {
+        //custom handle init response
+        MMPluginBaseClass* klass = MM_PLUGIN_BASE_GET_CLASS(task_priv->plugin);
+        if(klass->handle_custom_init_response != NULL)
+        {
+            klass->handle_custom_init_response(response);
+        }
     }
 
     /* Otherwise proceed to probing */
@@ -1239,6 +1246,7 @@ mm_plugin_base_class_init (MMPluginBaseClass *klass)
     g_type_class_add_private (object_class, sizeof (MMPluginBasePrivate));
 
     klass->handle_probe_response = real_handle_probe_response;
+    klass->handle_custom_init_response = NULL;
 
     /* Virtual methods */
     object_class->get_property = get_property;
diff --git a/src/mm-plugin-base.h b/src/mm-plugin-base.h
index a32d53b..a79be64 100644
--- a/src/mm-plugin-base.h
+++ b/src/mm-plugin-base.h
@@ -114,6 +114,8 @@ struct _MMPluginBaseClass {
                                    const char *response,
                                    const GError *error);
 
+    void (*handle_custom_init_response) (GString *response);
+
     /* Signals */
     void (*probe_result) (MMPluginBase *self,
                           MMPluginBaseSupportsTask *task,
-- 
1.7.1



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