aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-08-08 23:49:17 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-09-05 15:39:00 +0200
commit4cfe6c2985a6c6010f6500241baf7b97cedb7363 (patch)
tree058a5a5d225941503838bf7a40536d91542eebd6
parent8cde8a0f9496137ebdf951516c99b487c4feda2b (diff)
downloadexternal_libqmi-4cfe6c2985a6c6010f6500241baf7b97cedb7363.zip
external_libqmi-4cfe6c2985a6c6010f6500241baf7b97cedb7363.tar.gz
external_libqmi-4cfe6c2985a6c6010f6500241baf7b97cedb7363.tar.bz2
libqmi-glib,device: emit signal for every indication received
-rw-r--r--docs/reference/libqmi-glib/libqmi-glib-common.sections1
-rw-r--r--src/libqmi-glib/qmi-device.c28
-rw-r--r--src/libqmi-glib/qmi-device.h2
3 files changed, 31 insertions, 0 deletions
diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections
index ea76968..380d1fa 100644
--- a/docs/reference/libqmi-glib/libqmi-glib-common.sections
+++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections
@@ -42,6 +42,7 @@ qmi_client_get_type
<FILE>qmi-device</FILE>
<TITLE>QmiDevice</TITLE>
QMI_DEVICE_FILE
+QMI_DEVICE_SIGNAL_INDICATION
QmiDevice
qmi_device_new
qmi_device_new_finish
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
index e5462be..286f5d7 100644
--- a/src/libqmi-glib/qmi-device.c
+++ b/src/libqmi-glib/qmi-device.c
@@ -70,7 +70,13 @@ enum {
PROP_LAST
};
+enum {
+ SIGNAL_INDICATION,
+ SIGNAL_LAST
+};
+
static GParamSpec *properties[PROP_LAST];
+static guint signals [SIGNAL_LAST] = { 0 };
struct _QmiDevicePrivate {
/* File */
@@ -1246,6 +1252,9 @@ process_message (QmiDevice *self,
}
if (qmi_message_is_indication (message)) {
+ /* Generic emission of the indication */
+ g_signal_emit (self, signals[SIGNAL_INDICATION], 0, message);
+
if (qmi_message_get_client_id (message) == QMI_CID_BROADCAST) {
GHashTableIter iter;
gpointer key;
@@ -2551,4 +2560,23 @@ qmi_device_class_init (QmiDeviceClass *klass)
G_TYPE_FILE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class, PROP_FILE, properties[PROP_FILE]);
+
+ /**
+ * QmiClientDms::event-report:
+ * @object: A #QmiClientDms.
+ * @output: A #QmiIndicationDmsEventReportOutput.
+ *
+ * The ::event-report signal gets emitted when a '<link linkend="libqmi-glib-DMS-Event-Report.top_of_page">Event Report</link>' indication is received.
+ */
+ signals[SIGNAL_INDICATION] =
+ g_signal_new (QMI_DEVICE_SIGNAL_INDICATION,
+ G_OBJECT_CLASS_TYPE (G_OBJECT_CLASS (klass)),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BYTE_ARRAY);
}
diff --git a/src/libqmi-glib/qmi-device.h b/src/libqmi-glib/qmi-device.h
index c01626b..58e97c9 100644
--- a/src/libqmi-glib/qmi-device.h
+++ b/src/libqmi-glib/qmi-device.h
@@ -49,6 +49,8 @@ typedef struct _QmiDevicePrivate QmiDevicePrivate;
#define QMI_DEVICE_FILE "device-file"
+#define QMI_DEVICE_SIGNAL_INDICATION "indication"
+
/**
* QmiDevice:
*