iface-modem-3gpp: new interface to handle the Modem 3GPP DBus interface

This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:28 +01:00
parent b9448b83cb
commit 1d495c58e6
3 changed files with 108 additions and 0 deletions
+2
View File
@@ -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 \
+69
View File
@@ -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;
}
+37
View File
@@ -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 */