modem-manager: new `NMModemBroadband'
This new object, which is a subclass of `NMModem', implements the basic support of the new ModemManager1 interface.
This commit is contained in:

committed by
Dan Williams

parent
469e1a7164
commit
a9032724cb
@@ -27,9 +27,21 @@ if WITH_WIMAX
|
|||||||
nm_daemon_all_sources += $(top_srcdir)/src/wimax/*.[ch]
|
nm_daemon_all_sources += $(top_srcdir)/src/wimax/*.[ch]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nm_daemon_sources = \
|
nm_daemon_sources_no_bindings = \
|
||||||
$(filter-out %-glue.h %-bindings.h, $(wildcard $(nm_daemon_all_sources)))
|
$(filter-out %-glue.h %-bindings.h, $(wildcard $(nm_daemon_all_sources)))
|
||||||
|
|
||||||
|
if WITH_MODEM_MANAGER_1
|
||||||
|
# We filter out this file, which doesn't have any enum, and which clashes
|
||||||
|
# with ModemManager1-defined symbols
|
||||||
|
nm_daemon_sources = \
|
||||||
|
$(filter-out $(top_srcdir)/src/modem-manager/nm-modem-types.h, $(wildcard $(nm_daemon_sources_no_bindings)))
|
||||||
|
else
|
||||||
|
# Don't include ModemManager1-specific headers if we're not compiling with
|
||||||
|
# ModemManager1 support.
|
||||||
|
nm_daemon_sources = \
|
||||||
|
$(filter-out $(top_srcdir)/src/modem-manager/nm-modem-broadband.h, $(wildcard $(nm_daemon_sources_no_bindings)))
|
||||||
|
endif
|
||||||
|
|
||||||
GLIB_GENERATED = nm-enum-types.h nm-enum-types.c
|
GLIB_GENERATED = nm-enum-types.h nm-enum-types.c
|
||||||
nm_enum_types_sources = $(nm_daemon_sources)
|
nm_enum_types_sources = $(nm_daemon_sources)
|
||||||
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
|
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
|
||||||
@@ -70,6 +82,10 @@ libnm_generated_la_CPPFLAGS = \
|
|||||||
$(SYSTEMD_LOGIN_CFLAGS) \
|
$(SYSTEMD_LOGIN_CFLAGS) \
|
||||||
$(IWMX_SDK_CFLAGS)
|
$(IWMX_SDK_CFLAGS)
|
||||||
|
|
||||||
|
if WITH_MODEM_MANAGER_1
|
||||||
|
libnm_generated_la_CPPFLAGS += $(MM_GLIB_CFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
libnm_generated_la_LIBADD = \
|
libnm_generated_la_LIBADD = \
|
||||||
$(GLIB_LIBS)
|
$(GLIB_LIBS)
|
||||||
|
|
||||||
|
@@ -35,3 +35,11 @@ libmodem_manager_la_LIBADD = \
|
|||||||
$(LIBNL_LIBS) \
|
$(LIBNL_LIBS) \
|
||||||
$(DBUS_LIBS)
|
$(DBUS_LIBS)
|
||||||
|
|
||||||
|
# Support for the new ModemManager1 interface
|
||||||
|
if WITH_MODEM_MANAGER_1
|
||||||
|
libmodem_manager_la_SOURCES += \
|
||||||
|
nm-modem-broadband.h \
|
||||||
|
nm-modem-broadband.c
|
||||||
|
libmodem_manager_la_CPPFLAGS += $(MM_GLIB_CFLAGS)
|
||||||
|
libmodem_manager_la_LIBADD += $(MM_GLIB_LIBS)
|
||||||
|
endif
|
||||||
|
@@ -11,6 +11,15 @@ Common source
|
|||||||
the modem object.
|
the modem object.
|
||||||
|
|
||||||
|
|
||||||
|
ModemManager 0.7 integration
|
||||||
|
********************************************************************************
|
||||||
|
|
||||||
|
* nm-modem-broadband.[h|c]:
|
||||||
|
Defines the `NMModemBroadband' object, which is a subclass of `NMModem'.
|
||||||
|
This object handles both 3GPP and 3GPP2 modems exposed in the new
|
||||||
|
`ModemManager1' interface.
|
||||||
|
|
||||||
|
|
||||||
ModemManager 0.4/0.5/0.6 integration
|
ModemManager 0.4/0.5/0.6 integration
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
|
|
||||||
|
1029
src/modem-manager/nm-modem-broadband.c
Normal file
1029
src/modem-manager/nm-modem-broadband.c
Normal file
File diff suppressed because it is too large
Load Diff
69
src/modem-manager/nm-modem-broadband.h
Normal file
69
src/modem-manager/nm-modem-broadband.h
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||||
|
/* NetworkManager -- Network link manager
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 - Aleksander Morgado <aleksander@gnu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NM_MODEM_BROADBAND_H
|
||||||
|
#define NM_MODEM_BROADBAND_H
|
||||||
|
|
||||||
|
#include <dbus/dbus-glib.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include "nm-modem.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define NM_TYPE_MODEM_BROADBAND (nm_modem_broadband_get_type ())
|
||||||
|
#define NM_MODEM_BROADBAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MODEM_BROADBAND, NMModemBroadband))
|
||||||
|
#define NM_MODEM_BROADBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MODEM_BROADBAND, NMModemBroadbandClass))
|
||||||
|
#define NM_IS_MODEM_BROADBAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MODEM_BROADBAND))
|
||||||
|
#define NM_IS_MODEM_BROADBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_MODEM_BROADBAND))
|
||||||
|
#define NM_MODEM_BROADBAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MODEM_BROADBAND, NMModemBroadbandClass))
|
||||||
|
|
||||||
|
#define NM_MODEM_BROADBAND_MODEM "modem"
|
||||||
|
|
||||||
|
typedef struct _NMModemBroadband NMModemBroadband;
|
||||||
|
typedef struct _NMModemBroadbandClass NMModemBroadbandClass;
|
||||||
|
typedef struct _NMModemBroadbandPrivate NMModemBroadbandPrivate;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NM_MODEM_BROADBAND_ERROR_CONNECTION_NOT_GSM, /*< nick=ConnectionNotGsm >*/
|
||||||
|
NM_MODEM_BROADBAND_ERROR_CONNECTION_NOT_CDMA, /*< nick=ConnectionNotCdma >*/
|
||||||
|
NM_MODEM_BROADBAND_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/
|
||||||
|
NM_MODEM_BROADBAND_ERROR_CONNECTION_INCOMPATIBLE, /*< nick=ConnectionIncompatible >*/
|
||||||
|
} NMModemBroadbandError;
|
||||||
|
|
||||||
|
struct _NMModemBroadband {
|
||||||
|
NMModem parent;
|
||||||
|
NMModemBroadbandPrivate *priv;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _NMModemBroadbandClass {
|
||||||
|
NMModemClass parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType nm_modem_broadband_get_type (void);
|
||||||
|
|
||||||
|
NMModem *nm_modem_broadband_new (GObject *object);
|
||||||
|
|
||||||
|
void nm_modem_broadband_get_capabilities (NMModemBroadband *self,
|
||||||
|
NMDeviceModemCapabilities *modem_caps,
|
||||||
|
NMDeviceModemCapabilities *current_caps);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* NM_MODEM_BROADBAND_H */
|
Reference in New Issue
Block a user