port-probe: new MMPortProbe object

This commit is contained in:
Aleksander Morgado
2011-09-09 19:49:28 +02:00
committed by Aleksander Morgado
parent 916cf5dd3e
commit 74145f5af7
3 changed files with 111 additions and 0 deletions

View File

@@ -130,6 +130,8 @@ modem_manager_SOURCES = \
mm-modem-gsm-ussd.h \
mm-modem-simple.c \
mm-modem-simple.h \
mm-port-probe.h \
mm-port-probe.c \
mm-plugin.c \
mm-plugin.h \
mm-plugin-base.c \

62
src/mm-port-probe.c Normal file
View File

@@ -0,0 +1,62 @@
/* -*- 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 - Aleksander Morgado <aleksander@gnu.org>
*/
#include <stdio.h>
#include <stdlib.h>
#include "mm-port-probe.h"
#include "mm-errors.h"
#include "mm-log.h"
G_DEFINE_TYPE (MMPortProbe, mm_port_probe, G_TYPE_OBJECT)
struct _MMPortProbePrivate {
gpointer dummy;
};
MMPortProbe *
mm_port_probe_new (void)
{
MMPortProbe *self;
self = MM_PORT_PROBE (g_object_new (MM_TYPE_PORT_PROBE, NULL));
return self;
}
static void
mm_port_probe_init (MMPortProbe *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), \
MM_TYPE_PORT_PROBE, \
MMPortProbePrivate);
}
static void
finalize (GObject *object)
{
G_OBJECT_CLASS (mm_port_probe_parent_class)->finalize (object);
}
static void
mm_port_probe_class_init (MMPortProbeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (object_class, sizeof (MMPortProbePrivate));
/* Virtual methods */
object_class->finalize = finalize;
}

47
src/mm-port-probe.h Normal file
View File

@@ -0,0 +1,47 @@
/* -*- 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 Aleksander Morgado <aleksander@gnu.org>
*/
#ifndef MM_PORT_PROBE_H
#define MM_PORT_PROBE_H
#include <glib.h>
#include <glib-object.h>
#define MM_TYPE_PORT_PROBE (mm_port_probe_get_type ())
#define MM_PORT_PROBE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PORT_PROBE, MMPortProbe))
#define MM_PORT_PROBE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PORT_PROBE, MMPortProbeClass))
#define MM_IS_PORT_PROBE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PORT_PROBE))
#define MM_IS_PLUBIN_PROBE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PORT_PROBE))
#define MM_PORT_PROBE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PORT_PROBE, MMPortProbeClass))
typedef struct _MMPortProbe MMPortProbe;
typedef struct _MMPortProbeClass MMPortProbeClass;
typedef struct _MMPortProbePrivate MMPortProbePrivate;
struct _MMPortProbe {
GObject parent;
MMPortProbePrivate *priv;
};
struct _MMPortProbeClass {
GObjectClass parent;
};
GType mm_port_probe_get_type (void);
MMPortProbe *mm_port_probe_new (void);
#endif /* MM_PORT_PROBE_H */