diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-25 15:42:35 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-10 10:59:22 +0100 |
commit | 05b9ab7c25bf252e43037ed0ea002b0aed6f051b (patch) | |
tree | 996bf3a13e114298d450ce10136a6838d9f00006 /src/mm-bearer-list.c | |
parent | 35e20a48c8b16ae744c4ca3082f70e8aa674c2f4 (diff) |
api,modem: new 'MaxActiveMultiplexedBearers' property
In addition to the amount of bearers a user may connect without
multiplexing enabled (the default until now), we now also expose the
maximum number of bearers a user may connect after enabling
multiplexing over one single network interface (if supported).
The method responsible for creating the MMBearerList is now also
subclassable, so that implementations supporting multiplexing can
provide their own version with their own thresholds.
Diffstat (limited to 'src/mm-bearer-list.c')
-rw-r--r-- | src/mm-bearer-list.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index 8bf6ae05..b0694588 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -35,6 +35,7 @@ enum { PROP_0, PROP_NUM_BEARERS, PROP_MAX_ACTIVE_BEARERS, + PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS, PROP_LAST }; @@ -45,6 +46,7 @@ struct _MMBearerListPrivate { GList *bearers; /* Max number of active bearers */ guint max_active_bearers; + guint max_active_multiplexed_bearers; }; /*****************************************************************************/ @@ -55,6 +57,12 @@ mm_bearer_list_get_max_active (MMBearerList *self) return self->priv->max_active_bearers; } +guint +mm_bearer_list_get_max_active_multiplexed (MMBearerList *self) +{ + return self->priv->max_active_multiplexed_bearers; +} + gboolean mm_bearer_list_add_bearer (MMBearerList *self, MMBaseBearer *bearer, @@ -238,11 +246,13 @@ mm_bearer_list_disconnect_all_bearers (MMBearerList *self, /*****************************************************************************/ MMBearerList * -mm_bearer_list_new (guint max_active_bearers) +mm_bearer_list_new (guint max_active_bearers, + guint max_active_multiplexed_bearers) { /* Create the object */ return g_object_new (MM_TYPE_BEARER_LIST, MM_BEARER_LIST_MAX_ACTIVE_BEARERS, max_active_bearers, + MM_BEARER_LIST_MAX_ACTIVE_MULTIPLEXED_BEARERS, max_active_multiplexed_bearers, NULL); } @@ -261,6 +271,9 @@ set_property (GObject *object, case PROP_MAX_ACTIVE_BEARERS: self->priv->max_active_bearers = g_value_get_uint (value); break; + case PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS: + self->priv->max_active_multiplexed_bearers = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -282,6 +295,9 @@ get_property (GObject *object, case PROP_MAX_ACTIVE_BEARERS: g_value_set_uint (value, self->priv->max_active_bearers); break; + case PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS: + g_value_set_uint (value, self->priv->max_active_multiplexed_bearers); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -342,4 +358,13 @@ mm_bearer_list_class_init (MMBearerListClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (object_class, PROP_MAX_ACTIVE_BEARERS, properties[PROP_MAX_ACTIVE_BEARERS]); + properties[PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS] = + g_param_spec_uint (MM_BEARER_LIST_MAX_ACTIVE_MULTIPLEXED_BEARERS, + "Max active multiplexed bearers", + "Maximum number of active multiplexed bearers the list can handle", + 1, + G_MAXUINT, + 1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (object_class, PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS, properties[PROP_MAX_ACTIVE_MULTIPLEXED_BEARERS]); } |