aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@gnu.org>2011-09-09 19:49:28 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:20 +0100
commit74145f5af7c4e80ea09b86654fd524b4cd4759a8 (patch)
treeb5878d6417a2519b92c545bfe253bc4e099518e2
parent916cf5dd3e5476c38b795ae2bfac7b31c9497196 (diff)
port-probe: new MMPortProbe object
-rw-r--r--src/Makefile.am2
-rw-r--r--src/mm-port-probe.c62
-rw-r--r--src/mm-port-probe.h47
3 files changed, 111 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 87ca830b..86bcfd24 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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 \
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
new file mode 100644
index 00000000..e771362d
--- /dev/null
+++ b/src/mm-port-probe.c
@@ -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;
+}
diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h
new file mode 100644
index 00000000..4e46423b
--- /dev/null
+++ b/src/mm-port-probe.h
@@ -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 */
+