novatel: new `MMBroadbandModemNovatel'

This commit is contained in:
Aleksander Morgado
2012-07-30 21:06:12 +02:00
parent 56a7e40e37
commit 058fd0256d
3 changed files with 114 additions and 1 deletions

View File

@@ -312,7 +312,9 @@ libmm_plugin_novatel_lte_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
# Novatel non-LTE modem
libmm_plugin_novatel_la_SOURCES = \
novatel/mm-plugin-novatel.c \
novatel/mm-plugin-novatel.h
novatel/mm-plugin-novatel.h \
novatel/mm-broadband-modem-novatel.c \
novatel/mm-broadband-modem-novatel.h
libmm_plugin_novatel_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS)
libmm_plugin_novatel_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)

View File

@@ -0,0 +1,60 @@
/* -*- 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) 2008 - 2009 Novell, Inc.
* Copyright (C) 2009 - 2012 Red Hat, Inc.
* Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include "ModemManager.h"
#include "mm-base-modem-at.h"
#include "mm-broadband-modem-novatel.h"
#include "mm-errors-types.h"
#include "mm-log.h"
G_DEFINE_TYPE (MMBroadbandModemNovatel, mm_broadband_modem_novatel, MM_TYPE_BROADBAND_MODEM);
/*****************************************************************************/
MMBroadbandModemNovatel *
mm_broadband_modem_novatel_new (const gchar *device,
const gchar *driver,
const gchar *plugin,
guint16 vendor_id,
guint16 product_id)
{
return g_object_new (MM_TYPE_BROADBAND_MODEM_NOVATEL,
MM_BASE_MODEM_DEVICE, device,
MM_BASE_MODEM_DRIVER, driver,
MM_BASE_MODEM_PLUGIN, plugin,
MM_BASE_MODEM_VENDOR_ID, vendor_id,
MM_BASE_MODEM_PRODUCT_ID, product_id,
NULL);
}
static void
mm_broadband_modem_novatel_init (MMBroadbandModemNovatel *self)
{
}
static void
mm_broadband_modem_novatel_class_init (MMBroadbandModemNovatelClass *klass)
{
}

View File

@@ -0,0 +1,51 @@
/* -*- 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) 2008 - 2009 Novell, Inc.
* Copyright (C) 2009 - 2012 Red Hat, Inc.
* Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
*/
#ifndef MM_BROADBAND_MODEM_NOVATEL_H
#define MM_BROADBAND_MODEM_NOVATEL_H
#include "mm-broadband-modem.h"
#define MM_TYPE_BROADBAND_MODEM_NOVATEL (mm_broadband_modem_novatel_get_type ())
#define MM_BROADBAND_MODEM_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_NOVATEL, MMBroadbandModemNovatel))
#define MM_BROADBAND_MODEM_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_NOVATEL_AIRLINK, MMBroadbandModemNovatelClass))
#define MM_IS_BROADBAND_MODEM_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_NOVATEL_AIRLINK))
#define MM_IS_BROADBAND_MODEM_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_NOVATEL_AIRLINK))
#define MM_BROADBAND_MODEM_NOVATEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_NOVATEL_AIRLINK, MMBroadbandModemNovatelClass))
typedef struct _MMBroadbandModemNovatel MMBroadbandModemNovatel;
typedef struct _MMBroadbandModemNovatelClass MMBroadbandModemNovatelClass;
typedef struct _MMBroadbandModemNovatelPrivate MMBroadbandModemNovatelPrivate;
struct _MMBroadbandModemNovatel {
MMBroadbandModem parent;
MMBroadbandModemNovatelPrivate *priv;
};
struct _MMBroadbandModemNovatelClass{
MMBroadbandModemClass parent;
};
GType mm_broadband_modem_novatel_get_type (void);
MMBroadbandModemNovatel *mm_broadband_modem_novatel_new (const gchar *device,
const gchar *driver,
const gchar *plugin,
guint16 vendor_id,
guint16 product_id);
#endif /* MM_BROADBAND_MODEM_NOVATEL_H */