bearer-list: allow lookup by connected profile id
Some of the operations performed by the profile management interface will require checking whether the operation is attempted on a profile for which there is a known connected bearer object. We introduce a new method to lookup a bearer in the bearer list by its connected profile id.
This commit is contained in:
@@ -1290,6 +1290,12 @@ mm_base_bearer_get_config (MMBaseBearer *self)
|
||||
NULL);
|
||||
}
|
||||
|
||||
gint
|
||||
mm_base_bearer_get_profile_id (MMBaseBearer *self)
|
||||
{
|
||||
return mm_gdbus_bearer_get_profile_id (MM_GDBUS_BEARER (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
|
@@ -159,6 +159,7 @@ const gchar *mm_base_bearer_get_path (MMBaseBearer *self);
|
||||
MMBearerStatus mm_base_bearer_get_status (MMBaseBearer *self);
|
||||
MMBearerProperties *mm_base_bearer_peek_config (MMBaseBearer *self);
|
||||
MMBearerProperties *mm_base_bearer_get_config (MMBaseBearer *self);
|
||||
gint mm_base_bearer_get_profile_id (MMBaseBearer *self);
|
||||
|
||||
void mm_base_bearer_connect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
|
@@ -155,6 +155,22 @@ mm_bearer_list_find_by_path (MMBearerList *self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MMBaseBearer *
|
||||
mm_bearer_list_find_by_profile_id (MMBearerList *self,
|
||||
gint profile_id)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
g_assert (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN);
|
||||
|
||||
for (l = self->priv->bearers; l; l = g_list_next (l)) {
|
||||
if (mm_base_bearer_get_profile_id (MM_BASE_BEARER (l->data)) == profile_id)
|
||||
return g_object_ref (l->data);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
|
@@ -74,6 +74,8 @@ MMBaseBearer *mm_bearer_list_find_by_properties (MMBearerList *self,
|
||||
MMBearerProperties *properties);
|
||||
MMBaseBearer *mm_bearer_list_find_by_path (MMBearerList *self,
|
||||
const gchar *path);
|
||||
MMBaseBearer *mm_bearer_list_find_by_profile_id (MMBearerList *self,
|
||||
gint profile_id);
|
||||
|
||||
void mm_bearer_list_disconnect_all_bearers (MMBearerList *self,
|
||||
GAsyncReadyCallback callback,
|
||||
|
Reference in New Issue
Block a user