aboutsummaryrefslogtreecommitdiffstats
path: root/libqmi-glib/qmi-message.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-03 15:58:43 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-07-03 16:08:59 +0200
commitcb6985816bdafc40fee6d57c6320e18906990ba7 (patch)
tree87be9a395a77365a516afa0f4d4015cdf3e8e37b /libqmi-glib/qmi-message.h
parent4b8910554d91768db711c9f05ad992b8a70c590e (diff)
downloadexternal_libqmi-cb6985816bdafc40fee6d57c6320e18906990ba7.zip
external_libqmi-cb6985816bdafc40fee6d57c6320e18906990ba7.tar.gz
external_libqmi-cb6985816bdafc40fee6d57c6320e18906990ba7.tar.bz2
build: prepare sources to treat `libqmi-glib' not as the only library
Instead of keeping the libqmi-glib sources under `src', we'll have a more specific `libqmi-glib' directory instead. Also, update autotools to reflect as `libqmi' the name of the project.
Diffstat (limited to 'libqmi-glib/qmi-message.h')
-rw-r--r--libqmi-glib/qmi-message.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/libqmi-glib/qmi-message.h b/libqmi-glib/qmi-message.h
new file mode 100644
index 0000000..ff64a91
--- /dev/null
+++ b/libqmi-glib/qmi-message.h
@@ -0,0 +1,104 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+/*
+ * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * libqmi-glib -- GLib/GIO based library to control QMI devices
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; 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@lanedo.com>
+ */
+
+#ifndef _LIBQMI_GLIB_QMI_MESSAGE_H_
+#define _LIBQMI_GLIB_QMI_MESSAGE_H_
+
+#include <glib.h>
+
+#include "qmi-enums.h"
+
+G_BEGIN_DECLS
+
+#define QMI_MESSAGE_QMUX_MARKER (guint8)0x01
+typedef struct _QmiMessage QmiMessage;
+
+QmiMessage *qmi_message_new (QmiService service,
+ guint8 client_id,
+ guint16 transaction_id,
+ guint16 message_id);
+QmiMessage *qmi_message_new_from_raw (const guint8 *raw,
+ gsize raw_len);
+QmiMessage *qmi_message_ref (QmiMessage *self);
+void qmi_message_unref (QmiMessage *self);
+
+typedef void (* QmiMessageForeachTlvFn) (guint8 type,
+ gsize length,
+ gconstpointer value,
+ gpointer user_data);
+void qmi_message_tlv_foreach (QmiMessage *self,
+ QmiMessageForeachTlvFn callback,
+ gpointer user_data);
+
+gboolean qmi_message_tlv_get (QmiMessage *self,
+ guint8 type,
+ guint16 *length,
+ guint8 **value,
+ GError **error);
+
+gboolean qmi_message_tlv_add (QmiMessage *self,
+ guint8 type,
+ gsize length,
+ gconstpointer value,
+ GError **error);
+
+gconstpointer qmi_message_get_raw (QmiMessage *self,
+ gsize *length,
+ GError **error);
+
+guint16 qmi_message_get_qmux_length (QmiMessage *self);
+guint16 qmi_message_get_tlv_length (QmiMessage *self);
+gsize qmi_message_get_length (QmiMessage *self);
+
+gchar *qmi_message_get_printable (QmiMessage *self,
+ const gchar *line_prefix);
+
+gchar *qmi_message_get_tlv_printable (QmiMessage *self,
+ const gchar *line_prefix,
+ guint8 type,
+ gsize length,
+ gconstpointer value);
+
+gboolean qmi_message_check (QmiMessage *self,
+ GError **error);
+
+gboolean qmi_message_is_control (QmiMessage *self);
+gboolean qmi_message_is_response (QmiMessage *self);
+gboolean qmi_message_is_indication (QmiMessage *self);
+
+guint16 qmi_message_get_message_id (QmiMessage *self);
+QmiService qmi_message_get_service (QmiMessage *self);
+guint8 qmi_message_get_client_id (QmiMessage *self);
+guint16 qmi_message_get_transaction_id (QmiMessage *self);
+guint8 qmi_message_get_qmux_flags (QmiMessage *self);
+guint8 qmi_message_get_qmi_flags (QmiMessage *self);
+
+G_END_DECLS
+
+#endif /* _LIBQMI_GLIB_QMI_MESSAGE_H_ */