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-cbm-list.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-cbm-list.h')
-rw-r--r-- | src/mm-cbm-list.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/mm-cbm-list.h b/src/mm-cbm-list.h new file mode 100644 index 00000000..79a48878 --- /dev/null +++ b/src/mm-cbm-list.h @@ -0,0 +1,86 @@ +/* -*- 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_CBM_LIST_H +#define MM_CBM_LIST_H + +#include <glib.h> +#include <glib-object.h> + +#include "mm-base-modem.h" +#include "mm-base-cbm.h" +#include "mm-cbm-part.h" + +#define MM_TYPE_CBM_LIST (mm_cbm_list_get_type ()) +#define MM_CBM_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_CBM_LIST, MMCbmList)) +#define MM_CBM_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_CBM_LIST, MMCbmListClass)) +#define MM_IS_CBM_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_CBM_LIST)) +#define MM_IS_CBM_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_CBM_LIST)) +#define MM_CBM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_CBM_LIST, MMCbmListClass)) + +typedef struct _MMCbmList MMCbmList; +typedef struct _MMCbmListClass MMCbmListClass; +typedef struct _MMCbmListPrivate MMCbmListPrivate; + +#define MM_CBM_LIST_MODEM "cbm-list-modem" + +#define MM_CBM_ADDED "cbm-added" +#define MM_CBM_DELETED "cbm-deleted" + +struct _MMCbmList { + GObject parent; + MMCbmListPrivate *priv; +}; + +struct _MMCbmListClass { + GObjectClass parent; + + /* Signals */ + void (* cbm_added) (MMCbmList *self, + const gchar *cbm_path); + void (* cbm_deleted) (MMCbmList *self, + const gchar *sms_path); +}; + +GType mm_cbm_list_get_type (void); +G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCbmList, g_object_unref) + +MMCbmList *mm_cbm_list_new (MMBaseModem *modem); + +GStrv mm_cbm_list_get_paths (MMCbmList *self); +guint mm_cbm_list_get_count (MMCbmList *self); + +gboolean mm_cbm_list_has_part (MMCbmList *self, + guint16 serial, + guint16 message_id, + guint8 part_num); + +gboolean mm_cbm_list_take_part (MMCbmList *self, + MMCbmPart *part, + MMCbmState state, + GError **error); + +void mm_cbm_list_add_cbm (MMCbmList *self, + MMBaseCbm *cbm); + +void mm_cbm_list_delete_cbm (MMCbmList *self, + const gchar *cbm_path, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean mm_cbm_list_delete_cbm_finish (MMCbmList *self, + GAsyncResult *res, + GError **error); + +#endif /* MM_CBM_LIST_H */ |