plugin-base: explicitly request to probe for AT capabilities

This commit is contained in:
Aleksander Morgado
2011-11-23 11:11:13 +01:00
parent fa01e7a6d3
commit 4ad9374159
2 changed files with 20 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ typedef struct {
const gchar **vendor_strings; const gchar **vendor_strings;
const gchar **product_strings; const gchar **product_strings;
const gchar **udev_tags; const gchar **udev_tags;
gboolean at;
gboolean qcdm; gboolean qcdm;
const MMPortProbeAtCommand *custom_init; const MMPortProbeAtCommand *custom_init;
guint64 send_delay; guint64 send_delay;
@@ -82,6 +83,7 @@ enum {
PROP_ALLOWED_VENDOR_STRINGS, PROP_ALLOWED_VENDOR_STRINGS,
PROP_ALLOWED_PRODUCT_STRINGS, PROP_ALLOWED_PRODUCT_STRINGS,
PROP_ALLOWED_UDEV_TAGS, PROP_ALLOWED_UDEV_TAGS,
PROP_ALLOWED_AT,
PROP_ALLOWED_QCDM, PROP_ALLOWED_QCDM,
PROP_CUSTOM_INIT, PROP_CUSTOM_INIT,
PROP_SEND_DELAY, PROP_SEND_DELAY,
@@ -635,6 +637,8 @@ supports_port (MMPlugin *plugin,
/* Build flags depending on what probing needed */ /* Build flags depending on what probing needed */
probe_run_flags = 0; probe_run_flags = 0;
if (priv->at)
probe_run_flags |= MM_PORT_PROBE_AT;
if (need_vendor_probing) if (need_vendor_probing)
probe_run_flags |= MM_PORT_PROBE_AT_VENDOR; probe_run_flags |= MM_PORT_PROBE_AT_VENDOR;
if (need_product_probing) if (need_product_probing)
@@ -788,6 +792,10 @@ set_property (GObject *object, guint prop_id,
/* Construct only */ /* Construct only */
priv->udev_tags = (const gchar **)g_value_get_pointer (value); priv->udev_tags = (const gchar **)g_value_get_pointer (value);
break; break;
case PROP_ALLOWED_AT:
/* Construct only */
priv->at = g_value_get_boolean (value);
break;
case PROP_ALLOWED_QCDM: case PROP_ALLOWED_QCDM:
/* Construct only */ /* Construct only */
priv->qcdm = g_value_get_boolean (value); priv->qcdm = g_value_get_boolean (value);
@@ -838,6 +846,9 @@ get_property (GObject *object, guint prop_id,
case PROP_ALLOWED_PRODUCT_STRINGS: case PROP_ALLOWED_PRODUCT_STRINGS:
g_value_set_pointer (value, (gpointer)priv->product_strings); g_value_set_pointer (value, (gpointer)priv->product_strings);
break; break;
case PROP_ALLOWED_AT:
g_value_set_boolean (value, priv->at);
break;
case PROP_ALLOWED_QCDM: case PROP_ALLOWED_QCDM:
g_value_set_boolean (value, priv->qcdm); g_value_set_boolean (value, priv->qcdm);
break; break;
@@ -950,6 +961,14 @@ mm_plugin_base_class_init (MMPluginBaseClass *klass)
"should be an array of strings finished with 'NULL'", "should be an array of strings finished with 'NULL'",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property
(object_class, PROP_ALLOWED_AT,
g_param_spec_boolean (MM_PLUGIN_BASE_ALLOWED_AT,
"Allowed AT",
"Whether AT ports are allowed in this plugin",
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_ALLOWED_QCDM, (object_class, PROP_ALLOWED_QCDM,
g_param_spec_boolean (MM_PLUGIN_BASE_ALLOWED_QCDM, g_param_spec_boolean (MM_PLUGIN_BASE_ALLOWED_QCDM,

View File

@@ -42,6 +42,7 @@
#define MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS "allowed-vendor-strings" #define MM_PLUGIN_BASE_ALLOWED_VENDOR_STRINGS "allowed-vendor-strings"
#define MM_PLUGIN_BASE_ALLOWED_PRODUCT_STRINGS "allowed-product-strings" #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_UDEV_TAGS "allowed-udev-tags"
#define MM_PLUGIN_BASE_ALLOWED_AT "allowed-at"
#define MM_PLUGIN_BASE_ALLOWED_QCDM "allowed-qcdm" #define MM_PLUGIN_BASE_ALLOWED_QCDM "allowed-qcdm"
#define MM_PLUGIN_BASE_CUSTOM_INIT "custom-init" #define MM_PLUGIN_BASE_CUSTOM_INIT "custom-init"
#define MM_PLUGIN_BASE_SEND_DELAY "send-delay" #define MM_PLUGIN_BASE_SEND_DELAY "send-delay"