From 0e4bc1b6eab7f7d229655f60a1a86fc4aafd081b Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 5 Dec 2023 18:58:20 +0100 Subject: api: Add Cell Broadcast support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add access to the modem's CellBroadcast interface and to fetch Cell Broadcast messages. Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/253 Signed-off-by: Guido Günther --- libmm-glib/mm-object.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'libmm-glib/mm-object.c') diff --git a/libmm-glib/mm-object.c b/libmm-glib/mm-object.c index b58cb8fd..32e06611 100644 --- a/libmm-glib/mm-object.c +++ b/libmm-glib/mm-object.c @@ -320,6 +320,52 @@ mm_object_peek_modem_cdma (MMObject *self) /*****************************************************************************/ +/** + * mm_object_get_modem_cell_broadcast: + * @self: A #MMObject. + * + * Gets the #MMModemCellBroadcast instance for the D-Bus interface + * org.freedesktop.ModemManager1.Modem.ModemCellBroadcast on @self, if any. + * + * Returns: (transfer full): A #MMModemCellBroadcast that must be freed with + * g_object_unref() or %NULL if @self does not implement the interface. + * + * Since: 1.24 + */ +MMModemCellBroadcast * +mm_object_get_modem_cell_broadcast (MMObject *self) +{ + g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL); + + return (MMModemCellBroadcast *)mm_gdbus_object_get_modem_cell_broadcast (MM_GDBUS_OBJECT (self)); +} + +/** + * mm_object_peek_modem_cell_broadcast: (skip) + * @self: A #MMObject. + * + * Like mm_object_get_mm_modem_cell_broadcast() but doesn't increase the reference count + * on the returned object. + * + * It is not safe to use the returned object if you are on another + * thread than the one where the #MMManager is running. + * + * Returns: (transfer none): A #MMModemCellBroadcast or %NULL if @self does not + * implement the interface. Do not free the returned object, it is owned by + * @self. + * + * Since: 1.24 + */ +MMModemCellBroadcast * +mm_object_peek_modem_cell_broadcast (MMObject *self) +{ + g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL); + + return (MMModemCellBroadcast *)mm_gdbus_object_peek_modem_cell_broadcast (MM_GDBUS_OBJECT (self)); +} + +/*****************************************************************************/ + /** * mm_object_get_modem_simple: * @self: A #MMObject. -- cgit v1.2.3-70-g09d2