aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-07 14:23:15 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:22 +0100
commit9fbddcb8a94ae6755b6afccf9dcf070b4d9c45bd (patch)
tree55f4aa9420e0fa911feaf74d65ae77b7f437c842 /src
parent690777986b0efe6a38135ea8f42f392a6320cf77 (diff)
plugin-base: new property to specify that only one single AT port is expected
Will allow us to cancel other AT probings as soon as the first AT port is grabbed.
Diffstat (limited to 'src')
-rw-r--r--src/mm-plugin-base.c19
-rw-r--r--src/mm-plugin-base.h2
2 files changed, 20 insertions, 1 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 3d7be868..ecfc4b67 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -67,6 +67,7 @@ typedef struct {
mm_str_pair *product_strings;
gchar **udev_tags;
gboolean at;
+ gboolean single_at;
gboolean qcdm;
MMPortProbeAtCommand *custom_init;
guint64 send_delay;
@@ -83,6 +84,7 @@ enum {
PROP_ALLOWED_PRODUCT_STRINGS,
PROP_ALLOWED_UDEV_TAGS,
PROP_ALLOWED_AT,
+ PROP_ALLOWED_SINGLE_AT,
PROP_ALLOWED_QCDM,
PROP_CUSTOM_INIT,
PROP_SEND_DELAY,
@@ -659,6 +661,8 @@ supports_port (MMPlugin *plugin,
probe_run_flags = 0;
if (priv->at)
probe_run_flags |= MM_PORT_PROBE_AT;
+ else if (priv->single_at)
+ probe_run_flags |= MM_PORT_PROBE_AT;
if (need_vendor_probing)
probe_run_flags |= MM_PORT_PROBE_AT_VENDOR;
if (need_product_probing)
@@ -815,6 +819,10 @@ set_property (GObject *object, guint prop_id,
/* Construct only */
priv->at = g_value_get_boolean (value);
break;
+ case PROP_ALLOWED_SINGLE_AT:
+ /* Construct only */
+ priv->single_at = g_value_get_boolean (value);
+ break;
case PROP_ALLOWED_QCDM:
/* Construct only */
priv->qcdm = g_value_get_boolean (value);
@@ -864,6 +872,9 @@ get_property (GObject *object, guint prop_id,
case PROP_ALLOWED_AT:
g_value_set_boolean (value, priv->at);
break;
+ case PROP_ALLOWED_SINGLE_AT:
+ g_value_set_boolean (value, priv->single_at);
+ break;
case PROP_ALLOWED_QCDM:
g_value_set_boolean (value, priv->qcdm);
break;
@@ -989,6 +1000,14 @@ mm_plugin_base_class_init (MMPluginBaseClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property
+ (object_class, PROP_ALLOWED_SINGLE_AT,
+ g_param_spec_boolean (MM_PLUGIN_BASE_ALLOWED_SINGLE_AT,
+ "Allowed single AT",
+ "Whether just a single AT port is allowed in this plugin. ",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property
(object_class, PROP_ALLOWED_QCDM,
g_param_spec_boolean (MM_PLUGIN_BASE_ALLOWED_QCDM,
"Allowed QCDM",
diff --git a/src/mm-plugin-base.h b/src/mm-plugin-base.h
index 1f572638..11a5d137 100644
--- a/src/mm-plugin-base.h
+++ b/src/mm-plugin-base.h
@@ -43,6 +43,7 @@
#define MM_PLUGIN_BASE_ALLOWED_PRODUCT_STRINGS "allowed-product-strings"
#define MM_PLUGIN_BASE_ALLOWED_UDEV_TAGS "allowed-udev-tags"
#define MM_PLUGIN_BASE_ALLOWED_AT "allowed-at"
+#define MM_PLUGIN_BASE_ALLOWED_SINGLE_AT "allowed-single-at"
#define MM_PLUGIN_BASE_ALLOWED_QCDM "allowed-qcdm"
#define MM_PLUGIN_BASE_CUSTOM_INIT "custom-init"
#define MM_PLUGIN_BASE_SEND_DELAY "send-delay"
@@ -74,4 +75,3 @@ gboolean mm_plugin_base_get_device_ids (MMPluginBase *self,
guint16 *product);
#endif /* MM_PLUGIN_BASE_H */
-