libmm-glib,cell-broadcast: Support channels property

Support reading channels in the API too

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2025-03-29 22:19:17 +00:00
committed by Dan Williams
parent 4414344d82
commit d6367c76c0
2 changed files with 18 additions and 0 deletions
+11
View File
@@ -43,6 +43,8 @@ G_DEFINE_TYPE (MMModemCellBroadcast, mm_modem_cell_broadcast, MM_GDBUS_TYPE_MODE
struct _MMModemCellBroadcastPrivate {
/* Common mutex to sync access */
GMutex mutex;
PROPERTY_ARRAY_DECLARE (channels)
};
/*****************************************************************************/
@@ -91,6 +93,11 @@ mm_modem_cell_broadcast_dup_path (MMModemCellBroadcast *self)
RETURN_NON_EMPTY_STRING (value);
}
PROPERTY_ARRAY_DEFINE (channels,
ModemCellBroadcast, modem_cell_broadcast, MODEM_CELL_BROADCAST,
MMCellBroadcastChannels,
mm_common_cell_broadcast_channels_variant_to_garray)
/*****************************************************************************/
typedef struct {
@@ -411,6 +418,8 @@ mm_modem_cell_broadcast_init (MMModemCellBroadcast *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_MODEM_CELL_BROADCAST, MMModemCellBroadcastPrivate);
g_mutex_init (&self->priv->mutex);
PROPERTY_INITIALIZE (channels, "channels")
}
static void
@@ -420,6 +429,8 @@ finalize (GObject *object)
g_mutex_clear (&self->priv->mutex);
PROPERTY_ARRAY_FINALIZE (channels)
G_OBJECT_CLASS (mm_modem_cell_broadcast_parent_class)->finalize (object);
}
+7
View File
@@ -68,6 +68,13 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemCellBroadcast, g_object_unref)
const gchar *mm_modem_cell_broadcast_get_path (MMModemCellBroadcast *self);
gchar *mm_modem_cell_broadcast_dup_path (MMModemCellBroadcast *self);
gboolean mm_modem_cell_broadcast_get_channels (MMModemCellBroadcast *self,
MMCellBroadcastChannels **channels,
guint *n_storages);
gboolean mm_modem_cell_broadcast_peek_channels (MMModemCellBroadcast *self,
const MMCellBroadcastChannels **channels,
guint *n_storages);
void mm_modem_cell_broadcast_list (MMModemCellBroadcast *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,