diff options
author | Guido Günther <agx@sigxcpu.org> | 2023-12-05 20:05:17 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2024-12-01 21:41:10 +0000 |
commit | 62f7b76e8ea8f682048840741d1177e6c93a1c80 (patch) | |
tree | 37c6a4f9b96b942daf0fa1f85c6c322134a20469 /src/mm-iface-modem-cell-broadcast.h | |
parent | eedf78d6622d09862d9e91a54358f2b56344cc22 (diff) |
cbm: Add CellBroadcast interface
This adds support for the Cell Broadcast interface allowing to
receive, list, read and delete Cell Broadcast messages via the
org.freedesktop.ModemManager1.Modem.CellBroadcast and
org.freedesktop.ModemManager1.Cbm interfaces.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Diffstat (limited to 'src/mm-iface-modem-cell-broadcast.h')
-rw-r--r-- | src/mm-iface-modem-cell-broadcast.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/mm-iface-modem-cell-broadcast.h b/src/mm-iface-modem-cell-broadcast.h new file mode 100644 index 00000000..5990b865 --- /dev/null +++ b/src/mm-iface-modem-cell-broadcast.h @@ -0,0 +1,120 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2024 Guido Günther <agx@sigxcpu.org> + */ + +#ifndef MM_IFACE_MODEM_CELLBROADCAST_H +#define MM_IFACE_MODEM_CELLBROADCAST_H + +#include <glib-object.h> +#include <gio/gio.h> + +#define _LIBMM_INSIDE_MM +#include <libmm-glib.h> + +#include "mm-cbm-part.h" +#include "mm-base-cbm.h" + +#define MM_TYPE_IFACE_MODEM_CELL_BROADCAST mm_iface_modem_cell_broadcast_get_type () +G_DECLARE_INTERFACE (MMIfaceModemCellBroadcast, mm_iface_modem_cell_broadcast, MM, IFACE_MODEM_CELL_BROADCAST, MMIfaceModem) + +#define MM_IFACE_MODEM_CELL_BROADCAST_DBUS_SKELETON "iface-modem-cell-broadcast-dbus-skeleton" +#define MM_IFACE_MODEM_CELL_BROADCAST_CBM_LIST "iface-modem-cell-broadcast-cbm-list" + +struct _MMIfaceModemCellBroadcastInterface { + GTypeInterface g_iface; + + /* Check for CellBroadcast support (async) */ + void (* check_support) (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* check_support_finish) (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous setting up unsolicited CellBroadcast reception events */ + void (* setup_unsolicited_events) (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* setup_unsolicited_events_finish) (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous cleaning up of unsolicited CellBroadcast reception events */ + void (* cleanup_unsolicited_events) (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* cleanup_unsolicited_events_finish) (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous enabling unsolicited CellBroadcast reception events */ + void (* enable_unsolicited_events) (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* enable_unsolicited_events_finish) (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + + /* Asynchronous disabling unsolicited CellBroadcast reception events */ + void (* disable_unsolicited_events) (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (* disable_unsolicited_events_finish) (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + + /* Create Cbm objects */ + MMBaseCbm * (* create_cbm) (MMIfaceModemCellBroadcast *self); +}; + +/* Initialize CellBroadcast interface (async) */ +void mm_iface_modem_cell_broadcast_initialize (MMIfaceModemCellBroadcast *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_iface_modem_cell_broadcast_initialize_finish (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); +/* Enable CellBroadcast interface (async) */ +void mm_iface_modem_cell_broadcast_enable (MMIfaceModemCellBroadcast *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_iface_modem_cell_broadcast_enable_finish (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); + +/* Disable CellBroadcast interface (async) */ +void mm_iface_modem_cell_broadcast_disable (MMIfaceModemCellBroadcast *self, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_iface_modem_cell_broadcast_disable_finish (MMIfaceModemCellBroadcast *self, + GAsyncResult *res, + GError **error); +/* Shutdown CellBroadcast interface */ +void mm_iface_modem_cell_broadcast_shutdown (MMIfaceModemCellBroadcast *self); + +/* Bind properties for simple GetStatus() */ +void mm_iface_modem_cell_broadcast_bind_simple_status (MMIfaceModemCellBroadcast *self, + MMSimpleStatus *status); + +/* Report new CBM part */ +gboolean mm_iface_modem_cell_broadcast_take_part (MMIfaceModemCellBroadcast *self, + MMCbmPart *cbm_part, + MMCbmState state); + +/* CBM creation */ +MMBaseCbm *mm_iface_modem_cell_broadcast_create_cbm (MMIfaceModemCellBroadcast *self); + +#endif /* MM_IFACE_MODEM_CELLBROADCAST_H */ |