diff options
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 69 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.h | 37 |
3 files changed, 108 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index ee6cd6851..17606ddb6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,6 +116,8 @@ modem_manager_SOURCES = \ mm-base-modem.c \ mm-iface-modem.h \ mm-iface-modem.c \ + mm-iface-modem-3gpp.h \ + mm-iface-modem-3gpp.c \ mm-broadband-modem.h \ mm-broadband-modem.c \ mm-serial-parsers.c \ diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c new file mode 100644 index 000000000..9c24d67c0 --- /dev/null +++ b/src/mm-iface-modem-3gpp.c @@ -0,0 +1,69 @@ +/* -*- 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) 2011 Google, Inc. + */ + +#include <ModemManager.h> + +#include <mm-gdbus-modem.h> +#include <mm-enums-types.h> +#include <mm-errors-types.h> + +#include "mm-iface-modem-3gpp.h" +#include "mm-base-modem.h" +#include "mm-log.h" + +/*****************************************************************************/ + +static void +iface_modem_3gpp_init (gpointer g_iface) +{ + static gboolean initialized = FALSE; + + if (initialized) + return; + + /* Properties */ + g_object_interface_install_property + (g_iface, + g_param_spec_object (MM_IFACE_MODEM_3GPP_DBUS_SKELETON, + "3GPP DBus skeleton", + "DBus skeleton for the 3GPP interface", + MM_GDBUS_TYPE_MODEM3GPP_SKELETON, + G_PARAM_READWRITE)); + + initialized = TRUE; +} + +GType +mm_iface_modem_3gpp_get_type (void) +{ + static GType iface_modem_3gpp_type = 0; + + if (!G_UNLIKELY (iface_modem_3gpp_type)) { + static const GTypeInfo info = { + sizeof (MMIfaceModem3gpp), /* class_size */ + iface_modem_3gpp_init, /* base_init */ + NULL, /* base_finalize */ + }; + + iface_modem_3gpp_type = g_type_register_static (G_TYPE_INTERFACE, + "MMIfaceModem3gpp", + &info, + 0); + + g_type_interface_add_prerequisite (iface_modem_3gpp_type, MM_TYPE_BASE_MODEM); + } + + return iface_modem_3gpp_type; +} diff --git a/src/mm-iface-modem-3gpp.h b/src/mm-iface-modem-3gpp.h new file mode 100644 index 000000000..ead0e193b --- /dev/null +++ b/src/mm-iface-modem-3gpp.h @@ -0,0 +1,37 @@ +/* -*- 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) 2011 Google, Inc. + */ + +#ifndef MM_IFACE_MODEM_3GPP_H +#define MM_IFACE_MODEM_3GPP_H + +#include <glib-object.h> +#include <gio/gio.h> + +#define MM_TYPE_IFACE_MODEM_3GPP (mm_iface_modem_3gpp_get_type ()) +#define MM_IFACE_MODEM_3GPP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM_3GPP, MMIfaceModem3gpp)) +#define MM_IS_IFACE_MODEM_3GPP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_3GPP)) +#define MM_IFACE_MODEM_3GPP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_3GPP, MMIfaceModem3gpp)) + +#define MM_IFACE_MODEM_3GPP_DBUS_SKELETON "iface-modem-3gpp-dbus-skeleton" + +typedef struct _MMIfaceModem3gpp MMIfaceModem3gpp; + +struct _MMIfaceModem3gpp { + GTypeInterface g_iface; +}; + +GType mm_iface_modem_3gpp_get_type (void); + +#endif /* MM_IFACE_MODEM_3GPP_H */ |