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



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

diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 8d32e2a..3e32512 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(task, 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..4351082 100644
--- a/src/mm-plugin-base.h
+++ b/src/mm-plugin-base.h
@@ -114,6 +114,9 @@ struct _MMPluginBaseClass {
                                    const char *response,
                                    const GError *error);
 
+    void (*handle_custom_init_response) (MMPluginBaseSupportsTask *task,
+                                         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]