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);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
mm_base_bearer_get_profile_id (MMBaseBearer *self)
|
||||||
|
{
|
||||||
|
return mm_gdbus_bearer_get_profile_id (MM_GDBUS_BEARER (self));
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -155,10 +155,11 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseBearer, g_object_unref)
|
|||||||
|
|
||||||
void mm_base_bearer_export (MMBaseBearer *self);
|
void mm_base_bearer_export (MMBaseBearer *self);
|
||||||
|
|
||||||
const gchar *mm_base_bearer_get_path (MMBaseBearer *self);
|
const gchar *mm_base_bearer_get_path (MMBaseBearer *self);
|
||||||
MMBearerStatus mm_base_bearer_get_status (MMBaseBearer *self);
|
MMBearerStatus mm_base_bearer_get_status (MMBaseBearer *self);
|
||||||
MMBearerProperties *mm_base_bearer_peek_config (MMBaseBearer *self);
|
MMBearerProperties *mm_base_bearer_peek_config (MMBaseBearer *self);
|
||||||
MMBearerProperties *mm_base_bearer_get_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,
|
void mm_base_bearer_connect (MMBaseBearer *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
|
@@ -155,6 +155,22 @@ mm_bearer_list_find_by_path (MMBearerList *self,
|
|||||||
return NULL;
|
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 {
|
typedef struct {
|
||||||
|
@@ -70,10 +70,12 @@ void mm_bearer_list_foreach (MMBearerList *self,
|
|||||||
MMBearerListForeachFunc func,
|
MMBearerListForeachFunc func,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
MMBaseBearer *mm_bearer_list_find_by_properties (MMBearerList *self,
|
MMBaseBearer *mm_bearer_list_find_by_properties (MMBearerList *self,
|
||||||
MMBearerProperties *properties);
|
MMBearerProperties *properties);
|
||||||
MMBaseBearer *mm_bearer_list_find_by_path (MMBearerList *self,
|
MMBaseBearer *mm_bearer_list_find_by_path (MMBearerList *self,
|
||||||
const gchar *path);
|
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,
|
void mm_bearer_list_disconnect_all_bearers (MMBearerList *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
|
Reference in New Issue
Block a user