aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@gnu.org>2011-09-15 19:48:36 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:20 +0100
commita935cd9fb68df10c3b824251a3335e02ba40c322 (patch)
treebe55709f5214f2a2b2267d28312a4ba04757c6e6 /src
parent8ccb2229782a8a02306a61a382312d2e8bf206c7 (diff)
plugin-base: new 'allowed-capabilities' property
The plugins can set this property to filter support check requests by probed capabilities. The value given to the property should be a guint built as a mask of MM_PORT_PROBE_CAPABILITY flags, e.g.: const guint capabilities = (MM_PORT_PROBE_CAPABILITY_GSM | MM_PORT_PROBE_CAPABILITY_CDMA);
Diffstat (limited to 'src')
-rw-r--r--src/mm-plugin-base.c17
-rw-r--r--src/mm-plugin-base.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 812a125d..effb45c4 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -70,6 +70,7 @@ typedef struct {
gboolean sort_last;
/* Plugin-specific setups */
+ guint32 capabilities;
const gchar **subsystems;
const guint16 *vendor_ids;
const guint16 *product_ids;
@@ -81,6 +82,7 @@ typedef struct {
enum {
PROP_0,
PROP_NAME,
+ PROP_ALLOWED_CAPABILITIES,
PROP_ALLOWED_SUBSYSTEMS,
PROP_ALLOWED_VENDOR_IDS,
PROP_ALLOWED_PRODUCT_IDS,
@@ -1559,6 +1561,10 @@ set_property (GObject *object, guint prop_id,
/* Construct only */
priv->name = g_value_dup_string (value);
break;
+ case PROP_ALLOWED_CAPABILITIES:
+ /* Construct only */
+ priv->capabilities = (guint32)g_value_get_uint (value);
+ break;
case PROP_ALLOWED_SUBSYSTEMS:
/* Construct only */
priv->subsystems = (const gchar **)g_value_get_pointer (value);
@@ -1603,6 +1609,9 @@ get_property (GObject *object, guint prop_id,
case PROP_NAME:
g_value_set_string (value, priv->name);
break;
+ case PROP_ALLOWED_CAPABILITIES:
+ g_value_set_uint (value, (guint)priv->capabilities);
+ break;
case PROP_ALLOWED_SUBSYSTEMS:
g_value_set_pointer (value, (gpointer)priv->subsystems);
break;
@@ -1667,6 +1676,14 @@ mm_plugin_base_class_init (MMPluginBaseClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property
+ (object_class, PROP_ALLOWED_CAPABILITIES,
+ g_param_spec_uint (MM_PLUGIN_BASE_ALLOWED_CAPABILITIES,
+ "Allowed capabilities",
+ "Mask of capabilities this plugin can support",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property
(object_class, PROP_ALLOWED_SUBSYSTEMS,
g_param_spec_pointer (MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS,
"Allowed subsystems",
diff --git a/src/mm-plugin-base.h b/src/mm-plugin-base.h
index 230da630..055af991 100644
--- a/src/mm-plugin-base.h
+++ b/src/mm-plugin-base.h
@@ -124,6 +124,7 @@ typedef struct {
} MMPluginCustomInit;
#define MM_PLUGIN_BASE_NAME "name"
+#define MM_PLUGIN_BASE_ALLOWED_CAPABILITIES "allowed-capabilities"
#define MM_PLUGIN_BASE_ALLOWED_SUBSYSTEMS "allowed-subsystems"
#define MM_PLUGIN_BASE_ALLOWED_VENDOR_IDS "allowed-vendor-ids"
#define MM_PLUGIN_BASE_ALLOWED_PRODUCT_IDS "allowed-product-ids"